#24341 closed Cleanup/optimization (fixed)
Subclasses of django.contrib.postgres.forms.ranges.BaseRangeField should have more specific error messages
Reported by: | Alexey Boriskin | Owned by: | Chris Foresman |
---|---|---|---|
Component: | contrib.postgres | Version: | 1.8alpha1 |
Severity: | Normal | Keywords: | i18n, postgres 1.8-beta |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
I was translating new contrib.postgres strings on transifex and noticed that all range fields use the same error message: "Enter two valid values".
I suppose it may be misleading for the user of those fields, as the type of those values is not explicitly specified.
I propose that each subclass of BaseRangeField - IntegerRangeField, FloatRangeField, etc. to have its own 'invalid' error message - e.g. "Enter two valid integers", "Enter two valid dates", etc.
Change History (9)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
I don't mind, seems like it's probably a good idea. There aren't any technical challenges. The same code of the ValidationError should be kept across all the fields.
comment:3 by , 10 years ago
Cc: | removed |
---|---|
Easy pickings: | set |
Keywords: | 1.8-beta added |
Triage Stage: | Unreviewed → Accepted |
Type: | New feature → Cleanup/optimization |
comment:5 by , 10 years ago
Tim,
Should these just be "integers", "floats", or something more humane? E.g. "Enter two valid whole numbers"?
comment:6 by , 10 years ago
Has patch: | set |
---|
Pull request open here: https://github.com/django/django/pull/4169
comment:7 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Any opinion on this, Marc?