If that field has unique values, probably you can use that fileld as primary key.
Regards,
Amitesh Sahay91-750 797 8619
On Monday, 28 January, 2019, 7:18:35 PM IST, 'Odile Lambert' via Django users <django-users@googlegroups.com> wrote:
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
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/8bf1dd1b-f42c-8d31-3331-9b112d7ca888%40laposte.net.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment