#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)

errorlog.docx (24.1 KB) - added by hardcase 17 months ago.
erros log in doc

Download all attachments as: .zip

Change History (2)

Changed 17 months ago by hardcase

Attachment: errorlog.docx added

erros log in doc

comment:1 Changed 17 months ago by felixxm

Resolution: invalid
Status: newclosed
Summary: Charfield max length errorCharfield 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.

Note: See TracTickets for help on using tickets.
Back to Top