From the source code, you can see that Django 1.4\'s Form
class has a has_changed()
method and changed_data
property which seem rather
Here is a piece of code that does what @Ghopper21 is suggesting. To get the initial data, I use the values() function on the QueryDict. It returns a dictionary containing the data belonging to the object. An important caveat is that I haven't checked how it handles foreign key references.
saveStudentView(request,studentID):
existingData = Student.objects.filter(id=paperID).values()[0]
form = StudentForm(request.POST)
if form.is_valid():
form = StudentForm(request.POST, initial=existingData)
if not form.has_changed():
//Tell the user nothing has changed
else:
//Do other stuff