Re: How to use ModelForm for both new or existing data

2011-09-05 Thread Shawn Milochik
How about checking for the existence of course_id in the view? Then if it's blank you just send request.POST and if not you grab the instance in the view and pass it as the instance kwarg. Alternately you could do the same in the __init__ of the modelform, before you call the super __init__. It de

How to use ModelForm for both new or existing data

2011-09-05 Thread David
Hi, I'm having trouble figuring out the best way to use ModelForm in the following situation. I have these post variables coming into the view course_id course_department course_number And course_id may or may not be an empty string. If I do course_form = CourseForm(request.POST) Then the pro