[Django] #30613: Move index name check from Index.__init__ into system checks.

20 views
Skip to first unread message

Django

unread,
Jul 4, 2019, 10:49:56 AM7/4/19
to django-...@googlegroups.com
#30613: Move index name check from Index.__init__ into system checks.
-------------------------------------+-------------------------------------
Reporter: Can | Owner: nobody
Sarıgöl |
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The aim of this ticket is to make
[https://code.djangoproject.com/ticket/30397 Ticket 30397] cleaner.

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

Django

unread,
Jul 4, 2019, 10:51:55 AM7/4/19
to django-...@googlegroups.com
#30613: Move index name check from Index.__init__ into system checks.
-------------------------------------+-------------------------------------
Reporter: Can Sarıgöl | Owner: Can
Type: | Sarıgöl
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Can Sarıgöl):

* status: new => assigned
* owner: nobody => Can Sarıgöl
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/11539 PR]

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

Django

unread,
Jul 4, 2019, 11:16:08 AM7/4/19
to django-...@googlegroups.com
#30613: Move index name checks from Index.__init__ into system checks.
-------------------------------------+-------------------------------------

Reporter: Can Sarıgöl | Owner: Can
Type: | Sarıgöl
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Unreviewed => Accepted


Old description:

> The aim of this ticket is to make
> [https://code.djangoproject.com/ticket/30397 Ticket 30397] cleaner.

New description:

Index names assertions should be moved to system checks to keep code
cleaner and more consistent.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30613#comment:2>

Django

unread,
Jul 5, 2019, 4:07:58 AM7/5/19
to django-...@googlegroups.com
#30613: Move index name checks from Index.__init__ into system checks.
-------------------------------------+-------------------------------------

Reporter: Can Sarıgöl | Owner: Can
Type: | Sarıgöl
Cleanup/optimization | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"53209f78302a639032afabf5326d28d4ddd9d03c" 53209f78]:
{{{
#!CommitTicketReference repository=""
revision="53209f78302a639032afabf5326d28d4ddd9d03c"
Fixed #30613 -- Moved index name validation to system checks.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30613#comment:3>

Django

unread,
Apr 19, 2025, 8:56:22 PM4/19/25
to django-...@googlegroups.com
#30613: Move index name checks from Index.__init__ into system checks.
-------------------------------------+-------------------------------------
Reporter: Can Sarıgöl | Owner: Can
Type: | Sarıgöl
Cleanup/optimization | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham):

I'm not sure that moving this validation was appropriate.
`Index.__init__()` does
[https://github.com/django/django/blob/1831f7733d3ef03d1ca7fac3e8d9f4c5e3e3375e/django/db/models/indexes.py#L29-L64
a lot argument validation] and I don't see a reason why the validation of
`name` should be treated differently. See ticket:36273#comment:7.
--
Ticket URL: <https://code.djangoproject.com/ticket/30613#comment:4>
Reply all
Reply to author
Forward
0 new messages