Re: Avoid primary key in Django models.py

2017-08-04 Thread Samuel Dorsaz
if you remove your primary key, you will not be able to identify your record in your database, could you please precise what do you want to achieve by doing this ? Le vendredi 4 août 2017 14:07:19 UTC+2, jagadishreddy bommareddy a écrit : > > I am using Django frame work in that models.py in any

RE: Avoid primary key in Django models.py

2017-08-04 Thread Matthew Pava
You can’t. You can change what field is the primary key, but you can’t remove the primary key. Just specify primary_key=True on the field you would like to make your primary key. >From the docs: Each model requires exactly one field to have primary_key=True