I read this page: http://www.djangoproject.com/documentation/models/custom_pk/, and the example doesn’t list unique=True. I’m wondering if there is a compelling reason for them to leave it out, or if there is some reason I should include it. My assumption is that specifying primary_key=True does this automatically though. Any thoughts?
I read this page: http://www.djangoproject.com/documentation/models/custom_pk/ , and the example doesn’t list unique=True. I’m wondering
Share
http://docs.djangoproject.com/en/2.1/ref/models/fields/#primary-key
Your assumption is correct,
primary_key=Trueimpliesunique=True.