It seems like the newly added apply_changes method (to
form_for_instance) could be useful in other cases too if it was a bit
more "open-minded".
I don't see why apply_changes should bother about creating a field list
again when that has already been done in form_for_instance. Can't it
just use the fields in the Form?
How about if form_for_instance just set something like
`default_instance` for the form and apply_changes was made available to
all Forms. New method for BaseForm:
def apply_changes(self, instance=None, save=True):
if not instance:
instance = getattr(self, 'default_instance', None)
if not instance:
raise ValueError('An instance is required')
for field in self.fields.keys():
setattr(instance, f.attname, clean_data[f.name])
if save:
instance.save()
return instance