I'm following the Django book to learn Django. I'm getting unexpected
responses and can't find how to address this. It seems that submitting
an empty form is not handled as if it is empty ??

In views.py:
def search(request):
        if 'q' in request.GET:
                message = 'U zocht: %r' % request.GET['q']
        else:
                message = 'Leeg'
        return HttpResponse(message)

However, on submitting an empty form, the displayed message is:
U zocht: u''

On submitting a 'd', the answer is:
U zocht: u'd'

Consistent, that's the good news...

How to solve this?

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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