Does

request.POST['value'][0]['LastName']

work?

It looks like your post data has an array (keyed as 'value') of dicts.

You might also consider using Firebug (or something similar) to inspect the
http requests and responses when you are developing.


Regards,

Tamas



On Wed, Nov 11, 2009 at 2:38 PM, robinne <develo...@computer-shoppe.net>wrote:

>
> I am posting data from a form to a django view. The form is created
> using inputEx (a YUI-like interface). The form gets created much like
> you create a YUI form and you include names for all your fields in
> javascript. It is javascript that creates the form on the page.
>
> I am able to load database data from the django view into my form
> fields (sending json string to UI), but when I post I cannot access
> individual posted values, even though I can see that the
> 'request.POST' is getting posted to the django view. The request.POST
> looks something like <QueryDict:{u'value':
> [u'{"FirstName":"Mary","LastName":"Smith"...etc]}>
>
> When trying to access a value by using...
>
> def MemberInfo(request, member_id):
>    if request.method == "POST":
>        print request.POST
>        try:
>            print request.POST['LastName'] #ERROR
>
> ...
> error message is:
>  "POST /MemberInfo/1 HTTP/1.1" 500 54476
>
> any ideas?
>
>
> >
>

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