In a model for my database I am trying to define an Accounts table
with the id of a default Django User.
class Accounts(models.Model):
user = models.OneToOneField(User)
When I have it set up like this and try to add a user in the adduser
view:
def adduser(request):
username = request.POST['usern
Calling the following adduser function in views.py. I save the user
first because it's id (automatically created by Django upon INSERT) is
the primary/foreign key for accounts and passwords. Adding a user
seems to be working fine, but then when it gets to the
`Accounts(user=u)`, the following error
2 matches
Mail list logo