bootstrapman bootstrapman - 2 months ago 14
Python Question

Does Django's Field.unique creates a primary key?

Does Django's Field.unique creates a primary key. If not it will de normalize a table where it is declared?

Answer Source

This property just verify if the entering value exists in the db, if exists it will trigger an error.

For example you can use unique=True in your EmailField if you don't want to have duplicate emails.

You can see the docs here.

Regards.