[Zope3-dev] bug in "zope.app.form.browser.add.py"?

Egon Frerich e.frerich at nord-com.net
Thu Feb 16 11:41:03 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2006-02-13 I wrote a mail to Zope3-User ("factory - but object is not
initialized")

> for a content component I have programmed a factory to be sure numeric
> fields have 0.0. If I add an object without numeric values the
> introspectors tells me these fields have type "NoneType" and the values
> are "None".

Afterwards I looked for the reason. The input from the form is used in
the block "if self._set_after_add" in class AddView. If the user doesn't
fill in a field 'None' is set because the name of the empty field is in
the data.

Therefore line 117 should be

> if (name in data)& (data[name]<>None):

instead of

> if name in data:

Please can somebody check if this change is correct?

Egon



- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: e.frerich at nord-com.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD9KseuTzybIiyjvURAmhbAKCcOSIpnYrPoXt8Jfs0xl0QZ3FKFACfe5yb
hiGQ8zeyxoBN4pz9Bd6hj6s=
=uh+Y
-----END PGP SIGNATURE-----


More information about the Zope3-dev mailing list