On Tue, Jan 6, 2009 at 10:08 PM, Chris <chriss...@gmail.com> wrote: > > I've created a ModelForm from a model containing a foreign key field > (called user) linked to my User class. When the form is saved, I want > this value to be set to the current authenticated user. What's the > best way to do this? > > My form's save method takes the current user as an argument. I've > tried adding self.cleaned_data['user'] = user to this method, but it > appears to be ignored by the form.
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---