# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1242650169 -7200 # Node ID 646c2dd1f03edaf604b1875f6c12ffc4b39f2b3a # Parent c7a22540d6f7e0c3ab75e002172c44c2846d7785 #343290: inputs don't use value specified in URL diff -r c7a22540d6f7 -r 646c2dd1f03e web/form.py --- a/web/form.py Mon May 18 14:22:26 2009 +0200 +++ b/web/form.py Mon May 18 14:36:09 2009 +0200 @@ -372,6 +372,8 @@ return self.form_previous_values[qname] if qname in self.req.form: return self.req.form[qname] + if field.name in self.req.form: + return self.req.form[field.name] return None def form_field_value(self, field, load_bytes=False): diff -r c7a22540d6f7 -r 646c2dd1f03e web/test/unittest_form.py --- a/web/test/unittest_form.py Mon May 18 14:22:26 2009 +0200 +++ b/web/test/unittest_form.py Mon May 18 14:36:09 2009 +0200 @@ -64,7 +64,14 @@ self.assertEquals(len(states), 1) self.assertEquals(states[0][0], u'deactivated') # list of (combobox view, state eid) - + def test_consider_req_form_params(self): + e = self.etype_instance('CWUser') + e.eid = 'A' + form = EntityFieldsForm(self.request(login=u'toto'), None, entity=e) + field = StringField(name='login', eidparam=True) + form.append_field(field) + form.form_build_context({}) + self.assertEquals(form.form_field_display_value(field, {}), 'toto') # form view tests #########################################################