cleaner input_name implementation
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 21 Jan 2010 10:38:46 +0100
changeset 4302 8bedd7506d6e
parent 4301 59cb004db889
child 4303 35e814dce815
cleaner input_name implementation
web/formfields.py
--- a/web/formfields.py	Thu Jan 21 10:21:09 2010 +0100
+++ b/web/formfields.py	Thu Jan 21 10:38:46 2010 +0100
@@ -191,13 +191,12 @@
     @cached
     def input_name(self, form, suffix=None):
         """return 'qualified name' for this field"""
+        name = self.role_name()
+        if suffix is not None:
+            name += suffix
         if self.eidparam:
-            if suffix is None:
-                return eid_param(self.role_name(), form.edited_entity.eid)
-            return eid_param(self.role_name() + suffix, form.edited_entity.eid)
-        if suffix is None:
-            return self.name
-        return self.name + suffix
+            return eid_param(name, form.edited_entity.eid)
+        return name
 
     def role_name(self):
         """return <field.name>-<field.role> if role is specified, else field.name"""