First use:
from django.contrib.auth.models import UserThis gives access to the user model. Then just use the user as you would a normal foreign key reference
user_fk = models.ForeignKey(User)
Right, attempting not to sound nerdy as I'm definitely not a nerd. I have friends, I had sex once and yes, it was a woman and definitely not a flesh torch.
from django.contrib.auth.models import UserThis gives access to the user model. Then just use the user as you would a normal foreign key reference
user_fk = models.ForeignKey(User)
No comments:
Post a Comment