HaHa (After some reading).... Silly me my way is the get_profile route :) ....
On Mar 18, 4:58 pm, Johan <djjord...@gmail.com> wrote: > Hiya , > > I don't know the get_profile route (Am going to read up on that > now :)). But here is an example of what I'm using : > > class Student(models.Model): > base = models.OneToOneField(User, primary_key=True) > first_name = models.CharField(max_length=100) > last_name = models.CharField(max_length=100) > validation_code = models.CharField(max_length=100) > validated = models.BooleanField() > > def __unicode__(self): > return self.base.email > > It works quite good. > > On Mar 17, 6:49 pm, ntoll <ntoller...@gmail.com> wrote: > > > Guys, > > > Asking for advice here. > > > What is the best way to extend the User class in > > django.contrib.auth.models...? > > > I could either inherit the class for my own model and add fields / > > methods or use get_profile(). Now, whilst I realise that get_profile() > > is the official advice it seems a tad out-of-date now that there is > > model inheritance (for which get_profile() provided a means of > > overcoming). > > > Pros/cons of each method? To my mind inheriting from User class is > > more elegant... but would love to know your thoughts on this. > > > All the best, > > > ntoll > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---