On 10/04/2015 11:06 PM, Larry Martell wrote:
Reading this:
https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#extending-the-existing-user-model
I see this:
These profile models are not special in any way - they are just Django
models that happen to have a one-to-one link with a User model. As
such, they do not get auto created when a user is created, but a
django.db.models.signals.post_save could be used to create or update
related models as appropriate.
I have a related model set up just like this, and when I new user is
created a row in the related table is created. So what does this
comment in the docs mean when it says "they do not get auto created
when a user is created"?
I suspect you have established the profile model in the Admin where it
appears in-line with the user model. It is the Admin adding the 1:1
foreign key to the profile which creates the record on saving.
Remember, the Admin is an app and not part of core Django. The docs you
quote are about core Django.
If you are not using the Admin you might need to use the post_save
signal for the user model to create the profile model.
Mike
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/5529215F.5050609%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.