I'm creating a new model called Tickets which I want to ensure always has a valid userID assigned to it.
I'm using AUTH_PROFILE_MODULE
to setup the profile which also gives the error NameError: name 'User' is not defined when I try to run syndb.
How do I setup a foreign key to make sure this always is the case?
## tickets/models.py
class Ticket(models.Model):
user = models.ForeignKey(User,)
# More model stuff.
# accounts/models.py
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)