so I am using the code from the Django documentation to processes
information from a form  with the code :

def edit_place(request, place_id):
    try:
        manipulator = Place.ChangeManipulator(place_id)

    place = manipulator.original_object

    if request.method == 'POST':
        new_data = request.POST.copy()
        errors = manipulator.get_validation_errors(new_data)
        manipulator.do_html2python(new_data)
        if not errors:
            manipulator.save(new_data)

            return HttpResponseRedirect("/places/edit/%i/" % place.id)
    else:
        errors = {}
        new_data = manipulator.flatten_data()

    form = forms.FormWrapper(manipulator, new_data, errors)
    return render_to_response('places/edit_form.html', {'form': form,
'place': place})

However in my post data from my form I don't return data for all the
values in my model. This is because I don't want the user to be able
to change some of these, only to see them. I am not sure how to fill
the new_data dict with the old values (ones not being returned from
the form in the post method) when saving to the db.
 I have tried using a value old_data=manipulator.flatten_data() and
making a comparison and but have got a error

argument of type 'long' is not iterable

Help?


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