> ###### > try: > m = SomeModel.objects.get(pk=request.user) > except: > m = SomeModel() > ###### > > Attention, catch-all ("except" without an exception class) is evil. There are a lot of exception that could happen.
You could use: try: .... except SomeModel.DoesNotExist: ... or m, created = SomeModel.objects.get_or_create(pk=request.user) To my original question: Yes, I will use a signal handler to create the profiles. Thank you for your answers (Milian Andric). 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 -~----------~----~----~----~------~----~------~--~---