Re: User attribute access from within profile model

2009-05-27 Thread Karen Tracey
On Tue, May 26, 2009 at 4:12 PM, neridaj wrote: > > Is it only possible to access the methods of the associated User > object, and not the attributes? Even though I can access the full name > using get_full_name() I would still like to change the ordering to > last_name i.e., ordering = ['last_na

Re: User attribute access from within profile model

2009-05-26 Thread neridaj
Is it only possible to access the methods of the associated User object, and not the attributes? Even though I can access the full name using get_full_name() I would still like to change the ordering to last_name i.e., ordering = ['last_name']. Do I need to make a new method that only only returns

Re: User attribute access from within profile model

2009-05-26 Thread neridaj
It works with user.get_full_name(). Thanks, J On May 26, 12:14 pm, neridaj wrote: > I've tried bothuser.first_name anduser.last_name, which give no > errors, but display "user" instead of theattribute. > > On May 20, 12:05 am, Ayaz Ahmed Khan wrote: > > > On 20-May-09, at 12:12 AM, neridaj wr

Re: User attribute access from within profile model

2009-05-26 Thread neridaj
I've tried both user.first_name and user.last_name, which give no errors, but display "user" instead of the attribute. On May 20, 12:05 am, Ayaz Ahmed Khan wrote: > On 20-May-09, at 12:12 AM, neridaj wrote: > > > > > On May 19, 1:15 am, Ayaz Ahmed Khan wrote: > >> On 19-May-09, at 5:12 AM, neri

Re: User attribute access from within profile model

2009-05-19 Thread Ayaz Ahmed Khan
On 20-May-09, at 12:12 AM, neridaj wrote: > On May 19, 1:15 am, Ayaz Ahmed Khan wrote: >> On 19-May-09, at 5:12 AM, neri...@gmail.com wrote: >> >>> class Employee(models.Model): >>> user= models.ForeignKey(User, unique=True) >>> phone = PhoneNumberField() >>> ssn = models.CharField(max_len

Re: User attribute access from within profile model

2009-05-19 Thread Sam Chuparkoff
On Tue, 2009-05-19 at 12:12 -0700, neridaj wrote: > There are attributes for first_name and last_name, why wouldn't > user.first_name work? I'd expect an AttributeError is you are accessing an attribute that doesn't exist. Thus my assumption. sdc --~--~-~--~~~---~-

Re: User attribute access from within profile model

2009-05-19 Thread neridaj
There are attributes for first_name and last_name, why wouldn't user.first_name work? On May 19, 1:15 am, Ayaz Ahmed Khan wrote: > On 19-May-09, at 5:12 AM, neri...@gmail.com wrote: > > > class Employee(models.Model): > >  user= models.ForeignKey(User, unique=True) > >   phone = PhoneNumberField

Re: User attribute access from within profile model

2009-05-19 Thread Ayaz Ahmed Khan
On 19-May-09, at 5:12 AM, neri...@gmail.com wrote: > class Employee(models.Model): > user = models.ForeignKey(User, unique=True) > phone = PhoneNumberField() > ssn = models.CharField(max_length=11) > address = models.CharField(max_length=50) > city = models.CharField(max_length=30) >

Re: User attribute access from within profile model

2009-05-18 Thread Sam Chuparkoff
On Mon, 2009-05-18 at 17:12 -0700, neri...@gmail.com wrote: > I have an Employee profile associated with Users who are staff, how do > I return the associated user attributes from within the profile model > i.e., 'full_name' from Users? Anytime I try to access the User > attributes from within the

User attribute access from within profile model

2009-05-18 Thread neri...@gmail.com
Hello, I have an Employee profile associated with Users who are staff, how do I return the associated user attributes from within the profile model i.e., 'full_name' from Users? Anytime I try to access the User attributes from within the profile class I get errors: Cannot resolve keyword 'full_na