#31650: Mention uniqueness of constraint names in the "name" attribute docs.
--------------------------------------+------------------------------------
     Reporter:  Hanne Moa             |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  3.0
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  1                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by felixxm):

 * type:  Bug => Cleanup/optimization
 * easy:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 > It should be mentioned in the documentation whenever
 '''*Constraint.name''' is mentioned that the name needs to be unique for
 the database ...

 It's mentioned in ''"Constraints in abstract base classes"'' admonition.
 Moreover there is a system check for uniqueness of constraints names, see
 #30396. Nevertheless, I think we can add it also to the
 `CheckConstraint.name` and `UniqueConstraint.name`
 [https://docs.djangoproject.com/en/stable/ref/models/constraints/#name
 docs], e.g. ''"You must always specify a unique name for the
 constraint."''.

 > ... and for 3.0 the example should be updated to include `%(app_label)s`
 or at a minimum `%(class)s`.

 I don't agree, you don't need interpolation in most of cases.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31650#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.84e54a250f7e5bc45bc046033f838d59%40djangoproject.com.

Reply via email to