[Django] #23480: Length of Verbose_name of models is not checked

17 views
Skip to first unread message

Django

unread,
Sep 12, 2014, 7:36:07 AM9/12/14
to django-...@googlegroups.com
#23480: Length of Verbose_name of models is not checked
----------------------------------------------+--------------------
Reporter: d9pouces | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
The length of the verbose_name is not checked during model validation.
With some backends (PostgreSQL in my case), long verbose_names raise a
ValidationError during table creation:

django.core.exceptions.ValidationError: ["The verbose_name of
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is longer than 39 characters"]

I think that could be checked among other model validations.

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

Django

unread,
Sep 12, 2014, 7:42:54 AM9/12/14
to django-...@googlegroups.com
#23480: Length of Verbose_name of models is not checked
-------------------------------------+-------------------------------------

Reporter: d9pouces | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Validation for `verbose_name` was added in #18866, could you clarify if
something additional is needed (in what cases is the database error
raised)?

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

Django

unread,
Sep 15, 2014, 8:22:08 AM9/15/14
to django-...@googlegroups.com
#23480: Length of Verbose_name of models is not checked
-------------------------------------+-------------------------------------
Reporter: d9pouces | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.6
(models, ORM) | Resolution: needsinfo

Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: new => closed
* resolution: => needsinfo


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

Django

unread,
Sep 27, 2014, 8:25:04 PM9/27/14
to django-...@googlegroups.com
#23480: Length of Verbose_name of models is not checked
-------------------------------------+-------------------------------------

Reporter: d9pouces | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: closed => new
* resolution: needsinfo =>


Comment:

If I understand correctly, the complaint is not about a database error,
but about this validation happening only when the permissions are created
(that is, when the models are created in the database), rather than as a
check in the check framework (which would happen sooner and make fixing
easier).

Adding this as a check to django.contrib.auth makes sense to me, but I
leave it to people more intimate with django.contrib.auth to accept or
reject the ticket.

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

Django

unread,
Sep 28, 2014, 4:52:52 AM9/28/14
to django-...@googlegroups.com
#23480: Length of Verbose_name of models is not checked
-------------------------------------+-------------------------------------
Reporter: d9pouces | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.6
(models, ORM) | Resolution: wontfix

Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: new => closed

* resolution: => wontfix


Comment:

The only point where there's an arbitrary restriction on the length of
`verbose_name` is during the creation of permissions. We should lift that
restriction when we start adding migrations to contrib apps. At that point
we'll simply stop raising an exception when hitting the limit.

That's why I believe the current level of error reporting is appropriate.

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

Django

unread,
Sep 28, 2014, 3:17:57 PM9/28/14
to django-...@googlegroups.com
#23480: Length of Verbose_name of models is not checked
-------------------------------------+-------------------------------------
Reporter: d9pouces | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: wontfix
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

Just to close the loop, the `max_length` of `Permission.name` was
increased to 255 characters in #8162 so the `verbose_name` limit is
effectively 244 characters.

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

Reply all
Reply to author
Forward
0 new messages