# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1236879656 -3600 # Node ID 2353d14720944fafe78b032c32b8da5c41871af8 # Parent 739d4dce9b19aa2f609dee357bb2e1d55f1c6020 backport has_format method from entity diff -r 739d4dce9b19 -r 2353d1472094 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