Hiya.

Do exceptions like "PollDoesNotExist" get generated in a similar manner
that the lookups do?

I find that when processing a request, Django is throwing me exceptions
like "RespondentDoesNotExist", but if I try and catch that exception,
rather than using a bare "except:" statement, I get this:

NameError: global name 'RespondentDoesNotExist' is not defined

Should I just be using ObjectDoesNotExist, or is there a way of getting
the more accurately named exceptions?

While I have you, how do you get the data from a form out of a
manipulator after this step:

manipulator.do_html2python(new_data)

or don't you, and I should stick to re-using the POST data like so:

login_name__exact=request.POST['login']

And a final question, is there a better way to get HTTP header info out
of a request than this (which I haven't yet check to see if it even
works):

last_ip_address=request.META.get('REMOTE_ADDR')

Thanks for your help. I've got a dozen Django and Python related tabs
open in Firefox and I can't locate the answer in any of them. :)

jtm

Reply via email to