Changes between Initial Version and Version 1 of Ticket #18548


Ignore:
Timestamp:
Jul 8, 2012, 1:17:06 PM (12 years ago)
Author:
Aymeric Augustin
Comment:

Fixed formatting (please use preview).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18548 – Description

    initial v1  
    33Furthermore I have a view to to edit a Person:
    44
    5 
    6 ----------------------
     5{{{
    76def edit_climbing_place(request, person_id):
    87
     
    2423    print person.name
    2524
    26     return render_to_response('myProject/edit_person.html', {'form' : form, 'person': person}, context_instance=RequestContext(request))
    27 ------------------
     25    return render_to_response('myProject/edit_person.html',
     26        {'form' : form, 'person': person},
     27        context_instance=RequestContext(request))
     28}}}
    2829
    2930In the above code if form.is_valid() fails due to the 'unique_together' constraint is not satisfied then the two 'print person.name' outputs are different. In other words if I edit an existing 'Person' (say A) and change the name to a name which matches an already existing person (say B) in the same 'country' then in the above view the variable 'person.name' changes to that of B. All other fields, however, stay the same.
Back to Top