cubicweb/schemas/base.py
changeset 11767 432f87a63057
parent 11681 b23d58050076
child 11775 39cf9e55ada8
equal deleted inserted replaced
11766:d8de1ac21f36 11767:432f87a63057
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """core CubicWeb schema, but not necessary at bootstrap time"""
    18 """core CubicWeb schema, but not necessary at bootstrap time"""
    19 
    19 
    20 __docformat__ = "restructuredtext en"
    20 
       
    21 from yams.buildobjs import (EntityType, RelationType, RelationDefinition,
       
    22                             SubjectRelation, String, Bytes, TZDatetime, Password)
       
    23 
    21 from cubicweb import _
    24 from cubicweb import _
    22 
       
    23 from yams.buildobjs import (EntityType, RelationType, RelationDefinition,
       
    24                             SubjectRelation,
       
    25                             String, TZDatetime, Datetime, Password, Interval,
       
    26                             Boolean, Bytes, UniqueConstraint)
       
    27 from cubicweb.schema import (
    25 from cubicweb.schema import (
    28     RQLConstraint, WorkflowableEntityType, ERQLExpression, RRQLExpression,
    26     RQLConstraint, WorkflowableEntityType, ERQLExpression, RRQLExpression,
    29     PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS,
    27     PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS, RO_ATTR_PERMS)
    30     RO_ATTR_PERMS)
    28 
    31 
    29 
    32 class CWUser(WorkflowableEntityType):
    30 class CWUser(WorkflowableEntityType):
    33     """define a CubicWeb user"""
    31     """define a CubicWeb user"""
    34     __permissions__ = {
    32     __permissions__ = {
    35         'read':   ('managers', 'users', ERQLExpression('X identity U')),
    33         'read':   ('managers', 'users', ERQLExpression('X identity U')),
   319     log = String()
   317     log = String()
   320     status = String(required=True, internationalizable=True, indexed=True,
   318     status = String(required=True, internationalizable=True, indexed=True,
   321                     default='in progress',
   319                     default='in progress',
   322                     vocabulary=[_('in progress'), _('success'), _('failed')])
   320                     vocabulary=[_('in progress'), _('success'), _('failed')])
   323 
   321 
       
   322 
   324 class cw_import_of(RelationDefinition):
   323 class cw_import_of(RelationDefinition):
   325     __permissions__ = RELATION_MANAGERS_PERMISSIONS
   324     __permissions__ = RELATION_MANAGERS_PERMISSIONS
   326     subject = 'CWDataImport'
   325     subject = 'CWDataImport'
   327     object = 'CWSource'
   326     object = 'CWSource'
   328     cardinality = '1*'
   327     cardinality = '1*'