# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1236879686 -3600 # Node ID 7ca89f4468e4daee38ba91b3648d29ee60873f94 # Parent 2353d14720944fafe78b032c32b8da5c41871af8 fix format_field detection for fields not using FormatConstraint diff -r 2353d1472094 -r 7ca89f4468e4 schema.py --- a/schema.py Thu Mar 12 18:40:56 2009 +0100 +++ b/schema.py Thu Mar 12 18:41:26 2009 +0100 @@ -341,11 +341,8 @@ (the first tuple element containing the text and the second the text format) """ for rschema, _ in self.attribute_definitions(): - if rschema.type.endswith('_format'): - for constraint in self.constraints(rschema): - if isinstance(constraint, FormatConstraint): - yield self.subject_relation(rschema.type[:-7]), rschema - break + if rschema.type.endswith('_format') and self.has_subject_relation(rschema.type[:-7]): + yield self.subject_relation(rschema.type[:-7]), rschema def check_perm(self, session, action, eid=None): # NB: session may be a server session or a request object