#18548: View changes field when 'unique_together' is not satisfied in a Form
---------------------------+--------------------------------------
     Reporter:  anonymous  |                    Owner:  nobody
         Type:  Bug        |                   Status:  reopened
    Component:  Forms      |                  Version:  1.3
     Severity:  Normal     |               Resolution:
     Keywords:             |             Triage Stage:  Unreviewed
    Has patch:  0          |      Needs documentation:  0
  Needs tests:  0          |  Patch needs improvement:  0
Easy pickings:  0          |                    UI/UX:  0
---------------------------+--------------------------------------
Changes (by anonymous):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Sorry i did edit the code to simplify it a bit but i apparently did it too
 fast. This should be more clear:

 {{{
 #!python
 def edit_person(request, person_id):

     person = get_object_or_404(Person, pk=person_id)

     print person.name

     if not request.method == 'POST':
         form = PersonForm(instance=person)

     else:
         form = PersonForm(request.POST, instance=person)

         if form.is_valid():
             form.save()
             return HttpResponseRedirect(reverse(start_page))


     print person.name

     return render_to_response('myProject/edit_person.html',
         {'form' : form, 'person': person},
         context_instance=RequestContext(request))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18548#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to