Opened 6 years ago
Closed 6 years ago
#30406 closed Bug (invalid)
Charfield max length error.
Reported by: | hardcase | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 2.2 |
Severity: | Normal | Keywords: | max length restriction error |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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
Attachments (1)
Change History (2)
by , 6 years ago
Attachment: | errorlog.docx added |
---|
comment:1 by , 6 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Summary: | Charfield max length error → Charfield max length error. |
Thanks for the report, however it is some issue in your app not a bug in Django itself. Please use one of support channels.
erros log in doc