Changes between Initial Version and Version 1 of Ticket #18548


Ignore:
Timestamp:
07/08/2012 01:17:06 PM (3 years ago)
Author:
aaugustin
Comment:

Fixed formatting (please use preview).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18548

    • Property Needs documentation unset
    • Property Needs tests unset
    • Property Patch needs improvement unset
  • 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