Changes between Initial Version and Version 1 of Ticket #18548
- Timestamp:
- Jul 8, 2012, 1:17:06 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18548 – Description
initial v1 3 3 Furthermore I have a view to to edit a Person: 4 4 5 6 ---------------------- 5 {{{ 7 6 def edit_climbing_place(request, person_id): 8 7 … … 24 23 print person.name 25 24 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 }}} 28 29 29 30 In 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.