Adding a user to Postgres table: integrity error.

2011-11-16 Thread Tyre
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

Adding a user/accounts table to Postgres in Django View

2011-11-10 Thread Tyre
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