schema.py
branchtls-sprint
changeset 1090 a99dc223c583
parent 1045 5040a5835e4d
child 1099 2353d1472094
--- a/schema.py	Thu Mar 12 16:23:00 2009 +0100
+++ b/schema.py	Thu Mar 12 16:23:31 2009 +0100
@@ -323,6 +323,12 @@
         """return True if this entity type is used to build the schema"""
         return self.type in self.schema.schema_entity_types()
 
+    def has_format(self, attr):
+        """return true if this entity's schema has a format field for the given
+        attribute
+        """
+        return self.has_subject_relation('%s_format' % attr)
+
     def rich_text_fields(self):
         """return an iterator on (attribute, format attribute) of rich text field