entity.py
branchtls-sprint
changeset 1098 739d4dce9b19
parent 1090 a99dc223c583
child 1101 0c067de38e46
equal deleted inserted replaced
1097:611bacbbe001 1098:739d4dce9b19
   458                     needcheck = False
   458                     needcheck = False
   459                     break
   459                     break
   460         if mainattr == 'eid':
   460         if mainattr == 'eid':
   461             needcheck = False
   461             needcheck = False
   462         return mainattr, needcheck
   462         return mainattr, needcheck
   463 
       
   464     @cached
       
   465     def formatted_attrs(self):
       
   466         """returns the list of attributes which have some format information
       
   467         (i.e. rich text strings)
       
   468         """
       
   469         attrs = []
       
   470         for rschema, attrschema in self.e_schema.attribute_definitions():
       
   471             if attrschema.type == 'String' and self.has_format(rschema):
       
   472                 attrs.append(rschema.type)
       
   473         return attrs
       
   474 
   463 
   475     @classmethod
   464     @classmethod
   476     @obsolete('use method of the same name on the schema')
   465     @obsolete('use method of the same name on the schema')
   477     def has_format(cls, attr):
   466     def has_format(cls, attr):
   478         """return true if this entity's schema has a format field for the given
   467         """return true if this entity's schema has a format field for the given