[Django] #25628: SystemCheckError states "Invalid 'default' value" when no max_length on CharField is specified.

8 views
Skip to first unread message

Django

unread,
Oct 28, 2015, 4:27:26 PM10/28/15
to django-...@googlegroups.com
#25628: SystemCheckError states "Invalid 'default' value" when no max_length on
CharField is specified.
----------------------------------------------+--------------------
Reporter: zelo | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.9b1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Using django 1.9b1 i got this message during execution of makemigrations
command:
{{{
SystemCheckError: System check identified some issues:

ERRORS:
resources.Resource.test: (fields.E008) Invalid 'default' value: Ensure
this value has at most %(limit_value)d characters (it has %(show_value)d).
resources.Resource.test: (fields.E120) CharFields must define a
'max_length' attribute.
}}}

With this code:
{{{
test = models.CharField(
choices=(
('foo','bar'),
),
default='foo',
)
}}}

Adding max_length resolves both errors.

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

Django

unread,
Oct 28, 2015, 5:09:08 PM10/28/15
to django-...@googlegroups.com
#25628: SystemCheckError states "Invalid 'default' value" when no max_length on
CharField is specified.
-------------------------------------+-------------------------------------
Reporter: zelo | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.9b1
(models, ORM) |
Severity: Normal | Resolution: fixed
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 timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => fixed
* needs_tests: => 0
* needs_docs: => 0


Comment:

The "Invalid 'default'" feature was reverted in #25417.

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

Reply all
Reply to author
Forward
0 new messages