Thursday, March 23, 2017

inspectDB and 'id' can only be used as a field name if the field also sets 'primary_key=True'.

Hi.

You should rename the "id" field in your model to something else. You can edit your models.py and put another name, like "dbid" or something.

Django models reserve the "id" field for primary key; your table has another field as primary key.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/588c12ad-a29e-477d-bfcb-985c61fb658c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment