#30406: Charfield max length error
-------------------------------------+-------------------------------------
Reporter: hardcase | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.2
layer (models, ORM) | Keywords: max length
Severity: Normal | restriction error
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hello
I have the following bug:
“value too long for type character varying(20)”
It appears when I am trying to create entry in model with the following
field:
boat_name = models.CharField(max_length=50, unique=True, db_index=True,
verbose_name="Boat model", help_text="Please input boat model", )
As you can see max_length restriction here is 50 symbols, but error is
appear on 20 plus. I have tried to change this max_length in
database(postrgee), to change it by command :
ALTER TABLE boats_boatmodel ALTER COLUMN boat_name TYPE VARCHAR(50)
to change Charfielt to Textfield
to delete this field, then migrate, then add it again, then migrate – no
effect
to change max_length in models -no effect
--
Ticket URL: <https://code.djangoproject.com/ticket/30406>
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/051.da93f1097ffbb8c317680f83cf453c23%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.