Opened 5 years ago

Closed 5 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:

Description

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 manage.py runserver 80:

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

Orokusaki

Attachments (1)

orokusaki_db.models.fields.patch (1.5 KB) - added by orokusaki 5 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 5 years ago by orokusaki

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

comment:1 Changed 5 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.

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