avoid overriding specified values when guessing field stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 10 Jun 2009 18:45:06 +0200
branchstable
changeset 2095 897732d3ee5a
parent 2094 59a4e9f4f57a
child 2096 58c485797b03
avoid overriding specified values when guessing field
web/formfields.py
--- a/web/formfields.py	Wed Jun 10 18:44:45 2009 +0200
+++ b/web/formfields.py	Wed Jun 10 18:45:06 2009 +0200
@@ -455,17 +455,17 @@
         help = rschema.rproperty(eschema, targetschema, 'description')
         if rschema.is_final():
             if rschema.rproperty(eschema, targetschema, 'internationalizable'):
-                kwargs['internationalizable'] = True
+                kwargs.setdefault('internationalizable', True)
             def get_default(form, es=eschema, rs=rschema):
                 return es.default(rs)
-            kwargs['initial'] = get_default
+            kwargs.setdefault('initial', get_default)
     else:
         targetschema = rschema.subjects(eschema)[0]
         card = rschema.rproperty(targetschema, eschema, 'cardinality')[1]
         help = rschema.rproperty(targetschema, eschema, 'description')
     kwargs['required'] = card in '1+'
     kwargs['name'] = rschema.type
-    kwargs['help'] = help
+    kwargs.setdefault('help', help)
     if rschema.is_final():
         if skip_meta_attr and rschema in eschema.meta_attributes():
             return None