# HG changeset patch # User Adrien Di Mascio # Date 1253692302 -7200 # Node ID 36bcf206e157bceb1034f077e2dc6ac540128c71 # Parent b6564d9ca8727cc0e55966743643fdd2cabe6273 [schema] CWProperty is required at bootstrap time diff -r b6564d9ca872 -r 36bcf206e157 schemas/base.py --- a/schemas/base.py Wed Sep 23 09:48:34 2009 +0200 +++ b/schemas/base.py Wed Sep 23 09:51:42 2009 +0200 @@ -134,31 +134,7 @@ subject = '*' object = 'String' - -class CWProperty(EntityType): - """used for cubicweb configuration. Once a property has been created you - can't change the key. - """ - permissions = { - 'read': ('managers', 'users', 'guests'), - 'add': ('managers', 'users',), - 'update': ('managers', 'owners',), - 'delete': ('managers', 'owners',), - } - # key is a reserved word for mysql - pkey = String(required=True, internationalizable=True, maxsize=256, - description=_('defines what\'s the property is applied for. ' - 'You must select this first to be able to set ' - 'value')) - value = String(internationalizable=True, maxsize=256) - - for_user = SubjectRelation('CWUser', cardinality='?*', composite='object', - description=_('user for which this property is ' - 'applying. If this relation is not ' - 'set, the property is considered as' - ' a global property')) - - +# XXX find a better relation name class for_user(RelationType): """link a property to the user which want this property customization. Unless you're a site manager, this relation will be handled automatically. @@ -169,7 +145,10 @@ 'delete': ('managers',), } inlined = True - + subject = 'CWProperty' + object = 'CWUser' + composite = 'object' + cardinality = '?*' class CWPermission(EntityType): """entity type that may be used to construct some advanced security configuration diff -r b6564d9ca872 -r 36bcf206e157 schemas/bootstrap.py --- a/schemas/bootstrap.py Wed Sep 23 09:48:34 2009 +0200 +++ b/schemas/bootstrap.py Wed Sep 23 09:51:42 2009 +0200 @@ -173,6 +173,23 @@ +class CWProperty(EntityType): + """used for cubicweb configuration. Once a property has been created you + can't change the key. + """ + permissions = { + 'read': ('managers', 'users', 'guests'), + 'add': ('managers', 'users',), + 'update': ('managers', 'owners',), + 'delete': ('managers', 'owners',), + } + # key is a reserved word for mysql + pkey = String(required=True, internationalizable=True, maxsize=256, + description=_('defines what\'s the property is applied for. ' + 'You must select this first to be able to set ' + 'value')) + value = String(internationalizable=True, maxsize=256) + class relation_type(RelationType): """link a relation definition to its relation type""" permissions = META_RTYPE_PERMS