utils.py
branchstable
changeset 2332 b04d80f19075
parent 2258 79bc598c6411
child 2361 8f00836580f1
equal deleted inserted replaced
2331:4c02a761d879 2332:b04d80f19075
   324     """Mixin class for vobjects defining the 'accepts' attribute describing
   324     """Mixin class for vobjects defining the 'accepts' attribute describing
   325     a set of supported entity type (Any by default).
   325     a set of supported entity type (Any by default).
   326     """
   326     """
   327     # XXX deprecated, no more necessary
   327     # XXX deprecated, no more necessary
   328 
   328 
   329 
   329 def compute_cardinality(eschema, rschema, role):
       
   330     if role == 'subject':
       
   331         targetschema = rschema.objects(eschema)[0]
       
   332         return rschema.rproperty(eschema, targetschema, 'cardinality')[0]
       
   333     targetschema = rschema.subjects(eschema)[0]
       
   334     return rschema.rproperty(targetschema, eschema, 'cardinality')[1]
       
   335 
       
   336