schemas/base.py
changeset 2441 d7f0e551d0fa
parent 2438 576f4d51f826
parent 2434 ed85d69576b4
child 2456 aa25d6b244c8
equal deleted inserted replaced
2440:8e6b83e3b6b5 2441:d7f0e551d0fa
   203 
   203 
   204 class see_also(RelationType):
   204 class see_also(RelationType):
   205     """generic relation to link one entity to another"""
   205     """generic relation to link one entity to another"""
   206     symetric = True
   206     symetric = True
   207 
   207 
       
   208 class ExternalUri(EntityType):
       
   209     """a URI representing an object in external data store"""
       
   210     uri = String(required=True, unique=True, maxsize=256,
       
   211                  description=_('the URI of the object'))
       
   212 
       
   213 class same_as(RelationType):
       
   214     """generic relation to specify that an external entity represent the same
       
   215     object as a local one:
       
   216        http://www.w3.org/TR/owl-ref/#sameAs-def
       
   217 
       
   218     NOTE: You'll have to explicitly declare which entity types can have a
       
   219     same_as relation
       
   220     """
       
   221     permissions = {
       
   222         'read':   ('managers', 'users', 'guests',),
       
   223         'add':    ('managers', 'users'),
       
   224         'delete': ('managers', 'owners'),
       
   225         }
       
   226     cardinality = '*1'
       
   227     symetric = True
       
   228     # NOTE: the 'object = ExternalUri' declaration will still be mandatory
       
   229     #       in the cube's schema.
       
   230     object = 'ExternalUri'
   208 
   231 
   209 class CWCache(EntityType):
   232 class CWCache(EntityType):
   210     """a simple cache entity characterized by a name and
   233     """a simple cache entity characterized by a name and
   211     a validity date.
   234     a validity date.
   212 
   235