Opened 15 years ago
Closed 15 years ago
#13761 closed (invalid)
CharField.min_length doesn't work
| Reported by: | Oroku Saki | 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: | no | UI/UX: | no | 
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)
Change History (2)
by , 15 years ago
| Attachment: | orokusaki_db.models.fields.patch added | 
|---|
comment:1 by , 15 years ago
| Resolution: | → invalid | 
|---|---|
| Status: | new → 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.   
Might need to switch direction of min_length / max_length, etc but it's a start.