[forms] fix generated label for fields stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 06 Oct 2009 17:45:10 +0200
branchstable
changeset 3574 f179ccbd13e6
parent 3573 cdb41ceeffc7
child 3575 4123323acaea
[forms] fix generated label for fields
web/formfields.py
--- a/web/formfields.py	Tue Oct 06 17:18:23 2009 +0200
+++ b/web/formfields.py	Tue Oct 06 17:45:10 2009 +0200
@@ -536,9 +536,9 @@
     kwargs['required'] = card in '1+'
     kwargs['name'] = rschema.type
     if role == 'object':
-        kwargs['label'] = (eschema.type + '_object', rschema.type)
+        kwargs.setdefault('label', (eschema.type, rschema.type + '_object'))
     else:
-        kwargs['label'] = (eschema.type, rschema.type)
+        kwargs.setdefault('label', (eschema.type, rschema.type))
     kwargs.setdefault('help', help)
     if rschema.is_final():
         if skip_meta_attr and rschema in eschema.meta_attributes():