entity.py
branchtls-sprint
changeset 1090 a99dc223c583
parent 1031 1a89683cb687
child 1098 739d4dce9b19
--- a/entity.py	Thu Mar 12 16:23:00 2009 +0100
+++ b/entity.py	Thu Mar 12 16:23:31 2009 +0100
@@ -471,6 +471,14 @@
             if attrschema.type == 'String' and self.has_format(rschema):
                 attrs.append(rschema.type)
         return attrs
+
+    @classmethod
+    @obsolete('use method of the same name on the schema')
+    def has_format(cls, attr):
+        """return true if this entity's schema has a format field for the given
+        attribute
+        """
+        return cls.e_schema.has_format(attr)
         
     def format(self, attr):
         """return the mime type format for an attribute (if specified)"""
@@ -481,12 +489,6 @@
         """
         encoding = getattr(self, '%s_encoding' % attr, None)
         return encoding or self.vreg.property_value('ui.encoding')
-
-    def has_format(self, attr):
-        """return true if this entity's schema has a format field for the given
-        attribute
-        """
-        return self.e_schema.has_subject_relation('%s_format' % attr)
     
     def has_text_encoding(self, attr):
         """return true if this entity's schema has ab encoding field for the