Re: User Profile and Form initial values

2011-04-27 Thread James
Doh! As much as I read in the forms section, I skipped the ModelForms part, even though that's what I was using! Thanks again! James -- 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@googlegroup

Re: User Profile and Form initial values

2011-04-26 Thread Shawn Milochik
Yeah, it's documented. Right at the tippy-top of the ModelForms docs. http://docs.djangoproject.com/en/1.3/topics/forms/modelforms/ -- 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

Re: User Profile and Form initial values

2011-04-26 Thread Shawn Milochik
On 04/26/2011 06:04 PM, Kenny Meyer wrote: On Tue, Apr 26, 2011 at 4:17 PM, Shawn Milochik wrote: If you're creating a ModelForm that already has data in the database, don't pass in request.POST. Instead, pass in the instance with the 'instance' keyword argument. For example, if it was a Model

Re: User Profile and Form initial values

2011-04-26 Thread Kenny Meyer
On Tue, Apr 26, 2011 at 4:17 PM, Shawn Milochik wrote: > If you're creating a ModelForm that already has data in the database, don't > pass in request.POST. Instead, pass in the instance with the 'instance' > keyword argument. > > For example, if it was a ModelForm for the User object: form = > Us

Re: User Profile and Form initial values

2011-04-26 Thread James
That did it. 99% of the time the data will be there; I can write exception clauses for when it isn't. I think I'll use this method, though I had just discovered the "initial" dictionary argument as well, a few minutes before I noticed your reply. Is there a spot in the Django docs that explains thi

Re: User Profile and Form initial values

2011-04-26 Thread Shawn Milochik
If you're creating a ModelForm that already has data in the database, don't pass in request.POST. Instead, pass in the instance with the 'instance' keyword argument. For example, if it was a ModelForm for the User object: form = UserForm(instance = request.user) -- You received this messa

User Profile and Form initial values

2011-04-26 Thread James
I'm struggling to create a method by which a user can update his user profile, where the current information is displayed in the "edit" form, and I'm hoping someone here can point out what I'm doing wrong. I am not using ubernostrum's django-profiles for this because it hasn't been touched in quite