So first let me describe what I am attempting to do. I have an User model, a User Profile model and a Job model. I need to be able to list all jobs associated with a user and I need to show which user is associated with a job. This is what I am thinking, please let me know if i am in the right direction.`
class Job(models.Model):
title=models.CharField(max_length=30,blank=False)
description=models.TextField(blank=False)
...........................
class UsersJob(models.Model):
user=models.OneToOneField('User')
jobs=models.Foreignkey('Job')
Would it be better to connect jobs to the User object or the User profile as defined under AUTH_PROFILE_MODULE. Also am i in the right direction with what i am trying to get done
This completely depends on the type of relationship you need.
AUTH_PROFILE_MODULE?You would under most circumstances not want to point any FKs to this Profile table, because django works pretty tightly with the User model and you are more likely to have access to a list of Users than UserProfiles from which to query Jobs or whatever other relationship.