On 2/5/07, Waylan Limberg <[EMAIL PROTECTED]> wrote:
> On 2/4/07, Jason <[EMAIL PROTECTED]> wrote:
> >
> > Can anyone help with my super simple query string problem....
> >
> > I'm simply trying to get www.mysite.com/uptodate?build=123 parsed. The
> > problem is I can't get any URL to match (I keep getting 404 - page not
> > found).
> >
> >
> > My URL:
> >
> > (r'^uptodate(?P<build>\d+)/$)', prog.main.uptodate'),
> >
> > My View:
> >
> > def uptodate(request, build='123'):
> >
> >
> You only match the url, not the query string in urls.py:
>
>    (r'^uptodate'),

Sorry, that should be:

    (r'^uptodate', prog.main.uptodate'),

>
> Them in your view you access the query through request.GET
>
>     def uptodate(request):
>         if request.method == 'GET':
>             build = request.GET.get('build', '123')
>
> You could also just do:
>
>     build = request.get['build']
>
> But by using get() you can set a default and catch any failures if
> 'build' is missing - works the same as a Dict.
>
> --
> ----
> Waylan Limberg
> [EMAIL PROTECTED]
>


-- 
----
Waylan Limberg
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to