Re: Changing quixote.get_field?

Patrik Simons <[email protected]> Mon, 12 Nov 2012 22:21:36 +0200
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
On Mon, 12 Nov 2012 12:36:48 -0600 Neil Schemenauer <[email protected]> wrote:

> I'm considering changing the interface of quixote.get_field().  I
> find the function to be handy for quick access to form fields or
> query parameters.  However, the fact that it can sometimes return a
> list is quite annoying to deal with correctly.  Looking at my code I
> see I mostly forget about that.
>
> Does anyone object to changing quixote.get_field() to return the
> last field value if there are multiple values?  The behavior of
> HTTPRequest.get_field() would remain unchanged.
>

This would certainly break the principle of least surprise.

What is the motivation for returning the last field value instead of
the first?

--
Patrik


> Alternatively, I could introduce a new function and leave get_field
> alone.
>
> Regards,
>
>   Neil
> _______________________________________________
> Quixote-users mailing list
> [email protected]
> http://lists.quixote.ca/cgi-bin/mailman/listinfo/quixote-users
>