Thanks, you both are right.
user_form.save() is causing the INSERT of the related UserProfile
object. The User object in question here is django.contrib.auth's User
object.
It knows about the UserProfile model object from the following line in
settings.py
AUTH_PROFILE_MODULE = 'courses.userprofi
> Why is an INSERT statement being generated even though I have
> commit=False? The two inserts are causing an Exception which prevent
> the actual user data from being saved (a row in the
> courses_userprofile table does get created, but with all columns
> except the id being blank)
Its odd that
On Sep 20, 6:54 pm, Parag Shah wrote:
> Hello,
>
> I have a UserProfile Model object which has the
> django.contrib.auth.models.User as it's ForeignKey.
>
> There is a register function in the view module, which goes like this:
>
> def register(request):
> if request.method == 'POST':
> u
Hello,
I have a UserProfile Model object which has the
django.contrib.auth.models.User as it's ForeignKey.
There is a register function in the view module, which goes like this:
def register(request):
if request.method == 'POST':
user_form = UserCreationForm(request.POST)
user_pro
4 matches
Mail list logo