durusmail: quixote-users: quixote.form.form.Form, widget values, querystring containing "="
quixote.form.form.Form, widget values, querystring containing "="
2003-05-07
2003-05-08
2003-05-08
quixote.form.form.Form, widget values, querystring containing "="
Andrew Kuchling
2003-05-08
On Wed, May 07, 2003 at 11:57:47AM -0700, Alex Li wrote:
>I mean once you have an "=" in your url (ex: part of your querystring), any
>preset values (ie, Form.add_widget(value=...)) for any widgets won't appear,
>even the querystring parameters has nothing to do with those widgets with
>preset values.

This is because the framework thinks the form has been submitted.
>From the Form class:

    def form_submitted (self, request):
        """form_submitted(request : HTTPRequest) -> boolean

        Return true if a form was submitted in the current request.
        """
        return len(request.form) > 0

So, because it thinks the form has been submitted, all the widgets
take their value from the form contents, which are almost certainly
empty.

If this really bothers you, you could override the form_submitted()
method with a fancier implementation that only checks if the HTTP
method was a POST, and always returns false if it isn't.

--amk                                                    (www.amk.ca)
Welcome, one and all, to the far-flung future of -- 1965!
      -- Zot, in ZOT! #1

reply