Re: How to use request.GET??

2007-07-18 Thread Jeremy Dunck
On 7/18/07, Greg <[EMAIL PROTECTED]> wrote: > Do I have to return a HttpResponse? Yes. It is an error for an HTTP Request not to be given a HTTP response in return. In the 'if "favorite_color"' branch of your example view, simple "return response" just before the else: clause.

Re: How to use request.GET??

2007-07-18 Thread Greg
Also, when I use 'http://example.com/url_to_set_colour_view/? favorite_color=Blue' it gives me an error that says: 'The view mysite.rugs.views.set_color didn't return an HttpResponse object.' Do I have to return a HttpResponse? My view is shown above...if the 'if' statement is true the view

Re: How to use request.GET??

2007-07-18 Thread Greg
I've seen other Django websites that use the ? mark at the end. I've always wondered what the reason for that was. So the only time the ? mark is used is to send form data? On Jul 18, 9:33 pm, "Nimrod A. Abing" <[EMAIL PROTECTED]> wrote: > On 7/19/07, SmileyChris <[EMAIL PROTECTED]> wrote: > >

Re: How to use request.GET??

2007-07-18 Thread Nimrod A. Abing
On 7/19/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > On Jul 19, 2:22 pm, Greg <[EMAIL PROTECTED]> wrote: > > I was wondering how do I send a 'favorite_color' GET parameter? Do I > > have to use a form to do this that sends data by GET or is there > > another way to do it? > >

Re: How to use request.GET??

2007-07-18 Thread SmileyChris
On Jul 19, 2:22 pm, Greg <[EMAIL PROTECTED]> wrote: > I was wondering how do I send a 'favorite_color' GET parameter? Do I > have to use a form to do this that sends data by GET or is there > another way to do it? http://example.com/url_to_set_colour_view/?favorite_color=Blue

How to use request.GET??

2007-07-18 Thread Greg
Hello, I have the following function / def set_color(request): if "favorite_color" in request.GET: # Create an HttpResponse object... response = HttpResponse("Your favorite color is now %s" % \ request.GET["favorite_color"]) # ... and set a cookie