#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/047.292674c09b7b1a029d35dd8486fa6ae1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.