backport has_format method from entity tls-sprint
authorsylvain.thenault@logilab.fr
Thu, 12 Mar 2009 18:40:56 +0100
branchtls-sprint
changeset 1099 2353d1472094
parent 1098 739d4dce9b19
child 1100 7ca89f4468e4
backport has_format method from entity
schema.py
--- a/schema.py	Thu Mar 12 18:40:24 2009 +0100
+++ b/schema.py	Thu Mar 12 18:40:56 2009 +0100
@@ -329,6 +329,12 @@
         """
         return self.has_subject_relation('%s_format' % attr)
 
+    def has_format(self, attr):
+        """return true if this entity's schema has an encoding 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