[Django] #36808: Make UniqueConstraint name required in signature

2 views
Skip to first unread message

Django

unread,
Dec 18, 2025, 8:48:13 AM (21 hours ago) Dec 18
to django-...@googlegroups.com
#36808: Make UniqueConstraint name required in signature
-------------------------------------+-------------------------------------
Reporter: Jonathan | Owner: Jonathan Biemond
Biemond |
Type: | Status: assigned
Cleanup/optimization |
Component: Database | Version: 6.0
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
A `UniqueConstraint` requires a `name` argument, but is declared optional
(`=None`) in its signature. If `name` is omitted a `ValueError` is raised.
This may be confusing to developers.

The `name` argument was first made optional in the signature in commit
[3aa545281], which introduced support for functional unique constraints,
addressing ticket #30016.

More discussion on the forum: https://forum.djangoproject.com/t/make-
uniqueconstraint-name-required-in-signature/43664
--
Ticket URL: <https://code.djangoproject.com/ticket/36808>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 18, 2025, 8:57:47 AM (20 hours ago) Dec 18
to django-...@googlegroups.com
#36808: Make UniqueConstraint name required in signature
-------------------------------------+-------------------------------------
Reporter: Jonathan Biemond | Owner: Jonathan
Type: | Biemond
Cleanup/optimization | Status: assigned
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jonathan Biemond):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36808#comment:1>

Django

unread,
Dec 18, 2025, 10:40:40 AM (19 hours ago) Dec 18
to django-...@googlegroups.com
#36808: Make UniqueConstraint name required in signature
-------------------------------------+-------------------------------------
Reporter: Jonathan Biemond | Owner: Jonathan
Type: | Biemond
Cleanup/optimization | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Accepted
* version: 6.0 => dev

Comment:

Thanks. #36262 is a related ticket as Clifford pointed out on the forum.
--
Ticket URL: <https://code.djangoproject.com/ticket/36808#comment:2>

Django

unread,
Dec 18, 2025, 1:25:50 PM (16 hours ago) Dec 18
to django-...@googlegroups.com
#36808: Make UniqueConstraint name required in signature
-------------------------------------+-------------------------------------
Reporter: Jonathan Biemond | Owner: Jonathan
Type: | Biemond
Cleanup/optimization | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36808#comment:3>
Reply all
Reply to author
Forward
0 new messages