Re: Get first_name from User Model in to my Model

2008-05-05 Thread blis102
Are you trying to get first and last names from the User model? That would be either self.user.first_name and self.user.last_name (within model) or student.user.first_name and student.user.last_name (outside of model). Hope that helps a bit. On May 4, 8:13 pm, Jonathan Lukens <[EMAIL PROTECTED]>

Re: Get first_name from User Model in to my Model

2008-05-04 Thread Jonathan Lukens
Maybe are wanting to populate that field automatically and you are looking for a custom save() method? This would do the trick: ... def save(self): self.first_name = self.user.first_name super(Student, self).save() You will also want to add blank=True or editable=False to the CharField arg

Re: Get first_name from User Model in to my Model

2008-05-04 Thread Mike Chambers
user.firstname user.lastname ?? Is that what you are looking for? mike chiefmoamba wrote: > Hi, > > I am having a problem getting data from the user model in to my model > (below). I can get the usernames easy enough using "user = > models.ForeignKey(User)", but how then do I get the first_n

Get first_name from User Model in to my Model

2008-05-04 Thread chiefmoamba
Hi, I am having a problem getting data from the user model in to my model (below). I can get the usernames easy enough using "user = models.ForeignKey(User)", but how then do I get the first_name & last_name in to my model from the user model? Any ideas appreciated, Thanks, Ed class Student