[Django] #27904: Add a field check for validators

13 views
Skip to first unread message

Django

unread,
Mar 5, 2017, 11:55:35 AM3/5/17
to django-...@googlegroups.com
#27904: Add a field check for validators
-------------------------------------+-------------------------------------
Reporter: Adam | Owner: nobody
Chainz |
Type: New | Status: new
feature |
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 |
-------------------------------------+-------------------------------------
Reading #27884 I thought that a system check could be added to ensure
`Field.validators` is iterable, however it turns out that the refactoring
in #27235 actually made it impossible to instantiate a field with
`validators` not set to an iterable, as `Field.__init__` now calls `list`
on whatever the argument was.

However there is probably still value in a system check that iterates
`validators` and ensures they are all callable, and possibly that they
take one argument.

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

Django

unread,
Mar 5, 2017, 12:25:49 PM3/5/17
to django-...@googlegroups.com
#27904: Add a field check for validators
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

* owner: nobody => Adam Chainz
* status: new => assigned


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

Django

unread,
Mar 5, 2017, 12:44:52 PM3/5/17
to django-...@googlegroups.com
#27904: Add a system check for Field.validators

-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

Django

unread,
Mar 6, 2017, 8:26:33 AM3/6/17
to django-...@googlegroups.com
#27904: Add a system check that Field.validators are callable

-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
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 Tim Graham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/8147 PR] with comments for
improvement.

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

Django

unread,
Mar 11, 2017, 1:05:29 PM3/11/17
to django-...@googlegroups.com
#27904: Add a system check that Field.validators are callable
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
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: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"a452dddb253ff4fdd793351dac73eeef4d86b83e" a452ddd]:
{{{
#!CommitTicketReference repository=""
revision="a452dddb253ff4fdd793351dac73eeef4d86b83e"
Fixed #27904 -- Added a system check that Field.validators are callable.
}}}

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

Reply all
Reply to author
Forward
0 new messages