Re: ""Save" method throws duplicate key value violates unique constraint

2020-04-07 Thread Menaga Gopal
Thank you for the response. I was able to fix it by setting "user" field as the primary key in UserProperties model. Below is the updated version of the user field in UserProperties model. Just added "primary_key=True" to fix the duplicate key value issue. class UserProperties(models.Model):

Re: ""Save" method throws duplicate key value violates unique constraint

2020-04-06 Thread VenkataSivaRamiReddy
Use in place of one to one model field place foreign key field On Tue, Apr 7, 2020, 05:15 Menaga Gopal wrote: > > > > > Hello, > > I have 2 tables: > > 1) CustomUser table > - Id > - Email > - Name > > 2) UserProperties table > - id > - user (foreign key with one to one