RE: Legacy DB: ID is null when .save or .create

2019-05-17 Thread Matthew Pava
You may need to reset your auto increment counter in PostgreSQL. I remember having this problem once. https://stackoverflow.com/questions/5342440/reset-auto-increment-counter-in-postgres From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Mei B Sent: Friday,

Re: Legacy DB: ID is null when .save or .create

2019-05-17 Thread Sanjeev Singh
Hey, in django there is a `id` column by default get created for every object you create which will auto-increment so need to create here. In your case your model should be look like this: *class Case(models.Model):* * case_id = models.ForeignKey(.)* * user_id = models.ForeignKey(...)*