Thursday, November 1, 2012

unable to save ModelForm with primary key change

Hi,

I'm trying to modify a model instance, specifically the field which is
the model's primary key. When I save, nothing seems to happen.
Everything in cleaned_data is good, but the model is not updated. No
exception is thrown, the field isn't updated, nothing.

All I'm doing is

form = MyForm(request.POST, instance=model_instance)
if form.is_valid():
form.save()

I'm thinking that this might be an issue with respect to how sqlite
handles changes to primary key fields. Perhaps I'm handling the change
incorrectly. Help appreciated.

Using Django 1.4.1 with python-sqlite2 2.6.3 and 3.6.20.

Thanks,
Mike

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment