I've used the forms framework with GET (I'm using it for a search form
and a 'q' parameter), but it never occurred to me to use it to
validate non-form parameters.

Thanks!

- Andrew Ingram

2009/5/19 Russell Keith-Magee <freakboy3...@gmail.com>:
>
> On Tue, May 19, 2009 at 10:38 PM, Andrew Ingram <a...@andrewingram.net> wrote:
>>
>> This is the only real way to do this with Django, though I do wish
>> there was a core Django way to validate GET params, ie which ones are
>> allowed and what format they should be.
>
> You mean, something like the Forms framework? :-)
>
> Ordinarily, the Forms framework is used to handle inputs submitted
> using HTML <input> elements via a HTTP POST, but the Forms framework
> will work just as well with request.GET. Your Form definition can
> declare the get arguments that will be accepted, perform validation on
> them if required, specify default values, specify required arguments,
> and cross validate between optional arguments (i.e., if you specify x,
> you must specify y, but you can't specify z as well).
>
> The fact that you will never use the rendering portion of the Form
> doesn't matter at all - you just use the validation part that you
> require.
>
> Yours,
> Russ Magee %-)
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to