[Django] #30397: Allow app_label and class to be specified in the name argument for indexes and constraints.

58 views
Skip to first unread message

Django

unread,
Apr 24, 2019, 5:40:12 AM4/24/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Allow `%(app_label)s` and `%(class)s` to be specified in `name` argument
for `BaseConstraint` (`CheckConstraint`, `UniqueConstraint`) and `Index`:

- `%(class)s` should be replaced by the lowercased name of the child class
that the field is used in,
- `'%(app_label)s` should be replaced by the lowercased name of the app
the child class is contained within.

This should allow for specifying check constraints and partial indexes
(which `name`'s are mandatory) in abstract models.
Based on discussion in #30362.

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

Django

unread,
Apr 25, 2019, 5:06:44 AM4/25/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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 Can Sarıgöl):

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


Comment:

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

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

Django

unread,
Jun 5, 2019, 5:19:07 AM6/5/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1


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

Django

unread,
Jun 6, 2019, 4:00:22 AM6/6/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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 Can Sarıgöl):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0


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

Django

unread,
Jun 6, 2019, 4:18:45 AM6/6/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:4>

Django

unread,
Jun 8, 2019, 5:16:04 PM6/8/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:5>

Django

unread,
Jun 25, 2019, 7:07:26 AM6/25/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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 Can Sarıgöl):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:6>

Django

unread,
Jun 26, 2019, 5:46:33 AM6/26/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:7>

Django

unread,
Jun 26, 2019, 8:08:30 AM6/26/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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 Can Sarıgöl):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:8>

Django

unread,
Jul 4, 2019, 2:35:15 PM7/4/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


Comment:

OK, as per discussion on the PR, this is blocked pending a couple of
refactorings. Mainly #30613. Let's review again after that.

--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:9>

Django

unread,
Jul 5, 2019, 8:30:12 AM7/5/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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 Can Sarıgöl):

* needs_better_patch: 1 => 0


Comment:

#30613 has been merged. I guess that this pr is available to review again.

--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:10>

Django

unread,
Jul 8, 2019, 9:20:13 AM7/8/19
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: felixxm | Owner: Can
| Sarıgöl
Type: New feature | 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:"febe136d4c3310ec8901abecca3ea5ba2be3952c" febe136d]:
{{{
#!CommitTicketReference repository=""
revision="febe136d4c3310ec8901abecca3ea5ba2be3952c"
Fixed #30397 -- Added app_label/class interpolation for names of indexes
and constraints.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:11>

Django

unread,
Mar 6, 2024, 11:59:22 PM3/6/24
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Can
| Sarıgöl
Type: New feature | 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 GitHub <noreply@…>):

In [changeset:"9e35c8b2e37ab228b169e63a71f7221e4e85f3da" 9e35c8b]:
{{{#!CommitTicketReference repository=""
revision="9e35c8b2e37ab228b169e63a71f7221e4e85f3da"
Refs #30397 -- Optimized interpolation of index and constraint names a
bit.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:12>

Django

unread,
Mar 7, 2024, 11:49:43 PM3/7/24
to django-...@googlegroups.com
#30397: Allow app_label and class to be specified in the name argument for indexes
and constraints.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Can
| Sarıgöl
Type: New feature | 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 GitHub <noreply@…>):

In [changeset:"1669e54965e22d9bfd0cc8f8fb969704ac608163" 1669e549]:
{{{#!CommitTicketReference repository=""
revision="1669e54965e22d9bfd0cc8f8fb969704ac608163"
Refs #30397 -- Optimized interpolation of index and constraint names a bit
more.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30397#comment:13>
Reply all
Reply to author
Forward
0 new messages