On Nov 16, 12:01 am, Matt McClanahan <[EMAIL PROTECTED]>
wrote:
> On Nov 15, 8:51 pm, Steve  Potter <[EMAIL PROTECTED]> wrote:
>
> > It just seem that there should be a better way of doing this.  I was
> > thinking about a method that would perform the test for me and return
> > either the contents or a blank string.
>
> Often times, when it seems like something should exist, it's useful to
> operate on the assumption that it does, and go looking for it.  In
> this case, request.META is a glorified dictionary, and dictionaries
> have a get() method:http://docs.python.org/lib/typesmapping.html
>
> So you can use request.META.get('somekey', 'defaultvalue')
>
> Matt


Thanks Matt, for pointing out the obvious.

Steve


--~--~---------~--~----~------------~-------~--~----~
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