bootstrapman bootstrapman - 10 months ago 70
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download