Alvaro Mouriño schrieb: > I find myself checking for the existence of the profile object for the > user everytime I call the get_profile function or making sure that it > gets created with every user. > > Since a lot of users have this question/problem I added a patch to the documentation:
http://code.djangoproject.com/ticket/9987 +The method :class:`~django.contrib.auth.models.User.get_profile()` +does not create the profile, if it does not exist. You need to +register a handler for the signal +:attr:`django.db.models.signals.post_save` on the User model, and, in +the handler, if created=True, create the associated user profile. + Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---