schemas/base.py
changeset 4003 b9436fe77c9e
parent 3890 d7a270f50f54
child 4139 2718f2fd0576
equal deleted inserted replaced
3998:94cc7cad3d2d 4003:b9436fe77c9e
   133     cardinality = '11'
   133     cardinality = '11'
   134     subject = '*'
   134     subject = '*'
   135     object = 'String'
   135     object = 'String'
   136 
   136 
   137 
   137 
   138 class CWProperty(EntityType):
       
   139     """used for cubicweb configuration. Once a property has been created you
       
   140     can't change the key.
       
   141     """
       
   142     __permissions__ = {
       
   143         'read':   ('managers', 'users', 'guests'),
       
   144         'add':    ('managers', 'users',),
       
   145         'update': ('managers', 'owners',),
       
   146         'delete': ('managers', 'owners',),
       
   147         }
       
   148     # key is a reserved word for mysql
       
   149     pkey = String(required=True, internationalizable=True, maxsize=256,
       
   150                   description=_('defines what\'s the property is applied for. '
       
   151                                 'You must select this first to be able to set '
       
   152                                 'value'))
       
   153     value = String(internationalizable=True, maxsize=256)
       
   154 
       
   155     for_user = SubjectRelation('CWUser', cardinality='?*', composite='object',
       
   156                                description=_('user for which this property is '
       
   157                                              'applying. If this relation is not '
       
   158                                              'set, the property is considered as'
       
   159                                              ' a global property'))
       
   160 
       
   161 
       
   162 # XXX find a better relation name
   138 # XXX find a better relation name
   163 class for_user(RelationType):
   139 class for_user(RelationType):
   164     """link a property to the user which want this property customization. Unless
   140     """link a property to the user which want this property customization. Unless
   165     you're a site manager, this relation will be handled automatically.
   141     you're a site manager, this relation will be handled automatically.
   166     """
   142     """