checkng for uniqueness of a field in django Admin

15 views
Skip to first unread message

Odile Lambert

unread,
Jan 28, 2019, 8:48:49 AM1/28/19
to Django users

Hello

In django admin, I have a model with a model fiel "tech_number" which must be unique across the table. If I do not check the uniqueness, it raises a Django integrity error. According to the documentation it sounds normal.

I checked the uniqueness of the" tech_number" in the clean of the model form. but now it raises a validation error even in the change form. In fact it should ask if I needs to erase the existing one.

What did I miss?

Piscvau

Amitesh Sahay

unread,
Jan 28, 2019, 8:50:32 AM1/28/19
to Django users
If that field has unique values, probably you can use that fileld as primary key. 

Regards,
Amitesh Sahay
91-750 797 8619


--
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...@googlegroups.com.
To post to this group, send email to django...@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/8bf1dd1b-f42c-8d31-3331-9b112d7ca888%40laposte.net.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages