Hi,

I'm struggling with a simple edit-form. My model has a user-FK and
authenticated users can 'create' objects of this model with a form.
Pretty simple. They should be able to edit these objects later, but of
course not change the value of the user-field. So I excluded the
'User'-field in my ModelForm. I thought when I exclude a field from a
form it just keeps it's value when I call save() on the form. But I
always get this error when trying to save a valid form:

      ' null value in column "User_id" violates not-null constraint '

Is my way of thinking wrong? Adding the User-Field as a hidden field
to the form and then doing something like form.User=request.user
sounds pretty ugly. Especially when I just want to keep the original
value.

Regards,
Martin
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to