Opened 4 years ago

Closed 4 years ago

#13761 closed (invalid)

CharField.min_length doesn't work

Reported by: orokusaki Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords: validators
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Using trunk from Friday or so,

I see self.validators.append(validators.MaxLengthValidator(self.max_length)), but no self.validators.append(validators.MinLengthValidator(self.min_length)) in db.models.fields.

Here's the exception, using runserver 80:

TypeError: __init__() got an unexpected keyword argument 'min_length'


Attachments (1)

orokusaki_db.models.fields.patch (1.5 KB) - added by orokusaki 4 years ago.
Might need to switch direction of min_length / max_length, etc but it's a start.

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by orokusaki

Might need to switch direction of min_length / max_length, etc but it's a start.

comment:1 Changed 4 years ago by orokusaki

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Oops, I've mistaken form field docs for model field docs. This would be a nice python-level validation though, even if it's not available at the DB level.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.