Don't forget to run manage.py syncdb to create table/s for your model/s.

On Mon, Aug 30, 2010 at 5:28 PM, Sithembewena Lloyd Dube
<zebr...@gmail.com>wrote:

> Hi João,
>
> Add myapp.UserProfile to the INSTALLED_APPS global variable of your
> settings.py file, and in your admin.py file, import the model/s.
>
>
> On Mon, Aug 30, 2010 at 5:04 PM, João Rodrigues <jvrodrig...@gmail.com>wrote:
>
>> I have a company model
>>
>> class Company(models.Model):
>>    name = models.CharField(max_length=50)
>>    address = models.TextField()
>>    phone = models.CharField(max_length=15)
>>    fax = models.CharField(max_length=15)
>>
>> and I wanted to associate each user to a company, so I read
>>
>> http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
>> added AUTH_PROFILE_MODULE = "myapp.UserProfile" to settings.py and
>> created a UserProfile model
>>
>> class UserProfile(models.Model):
>>    user = models.OneToOneField(User)
>>    company = models.OneToOneField(Company)
>>
>>
>> How do I make it appear in the admin interface?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
> http://www.lloyddube.com
>



-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to