Re: Connect users in models.py to admin site users

2008-04-21 Thread chiefmoamba

hang on, I may have found the answer here:
http://groups.google.com/group/django-users/browse_thread/thread/8933164dfc790200/f7ef4498f1391aac?lnk=gst=link+class+to+user#f7ef4498f1391aac

On Apr 20, 8:29 pm, chiefmoamba <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a model in models.py as shown below:
>
> class Tutor(models.Model):
> first_name = models.CharField(maxlength=40)
> last_name = models.CharField(maxlength=40, core=True)
> etc...
> etc...
>
> It simply captures fname and lname and adds it to my database. It
> works.
>
> However, the 'Tutor' should also be an user on my site, as found in
> the Auth section of the admin page. Clearly, I don't ant to replicate
> the information, that'd be silly, right?
>
> What I'd like to do is two fold:
>
> 1)  Add a field to Auth Users section to show whether a user is a
> Tutor or a Student
> 2) Use a ForeignKey (I guess thats best right) to add the names of the
> user to my Tutor Model above.
>
> Can anyone help me with this, please? I don't even know how to find
> the Admin Auth Users Model at the moment and try as I might, I can
> find nothing on the web to help me solve the issue. Any help is
> appreciated!
>
> Thanks,
>
> Ed
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Connect users in models.py to admin site users

2008-04-20 Thread chiefmoamba

Hello,

I have a model in models.py as shown below:

class Tutor(models.Model):
first_name = models.CharField(maxlength=40)
last_name = models.CharField(maxlength=40, core=True)
etc...
etc...

It simply captures fname and lname and adds it to my database. It
works.

However, the 'Tutor' should also be an user on my site, as found in
the Auth section of the admin page. Clearly, I don't ant to replicate
the information, that'd be silly, right?

What I'd like to do is two fold:

1)  Add a field to Auth Users section to show whether a user is a
Tutor or a Student
2) Use a ForeignKey (I guess thats best right) to add the names of the
user to my Tutor Model above.

Can anyone help me with this, please? I don't even know how to find
the Admin Auth Users Model at the moment and try as I might, I can
find nothing on the web to help me solve the issue. Any help is
appreciated!

Thanks,

Ed
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---