fix label in generated form for relations stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 06 Oct 2009 16:56:22 +0200
branchstable
changeset 3563 f1dbb9bf4da3
parent 3562 cff18f0d7c73
child 3573 cdb41ceeffc7
fix label in generated form for relations the label for object relations was incorrect, because the '_object' mangling is done on the wrong component of field.label. fix ticket 472831
web/formfields.py
--- a/web/formfields.py	Tue Oct 06 14:14:16 2009 +0200
+++ b/web/formfields.py	Tue Oct 06 16:56:22 2009 +0200
@@ -576,6 +576,8 @@
                                                                 skip_meta_attr=False)
         return fieldclass(**kwargs)
     kwargs['role'] = role
+    if role == 'object': # tag the type with '_object' instead of the type
+        kwargs['label'] = (eschema.type, rschema.type + '_object')
     return RelationField.fromcardinality(card, **kwargs)