#34071: Unclear / mismatched validator messages in code for
RangeMaxValueValidator
& RangeMinValueValidator compared to docs
-------------------------------------+-------------------------------------
Reporter: Jack | Owner: (none)
Linke |
Type: | Status: new
Cleanup/optimization |
Component: | Version: dev
contrib.postgres | Keywords: postgres, range,
Severity: Normal | validator, validators
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The wording in the documentation for {{{ RangeMaxValueValidator }}} and
{{{ RangeMinValueValidator }}} is very clear:
{{{#!python
"Validates that the upper bound of the range is not greater than
limit_value."
"Validates that the lower bound of the range is not less than the
limit_value."
}}}
[https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/docs/ref/contrib/postgres/validators.txt]
The wording in the validator messages (and validator test messages) within
the code itself is somewhat confusing in comparison:
{{{#!python
"Ensure that this range is completely less than or equal to
%(limit_value)s."
"Ensure that this range is completely greater than or equal to
%(limit_value)s."
}}}
[https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/django/contrib/postgres/validators.py]
[https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/tests/postgres_tests/test_ranges.py]
Recommending a patch to modify the messages in the validator (and
validator test) code to match the documentation, making it more clear to
users exactly what the range validators do.
----
Patch 16146 on Django's GitHub PR tracker should resolve this.
[https://github.com/django/django/pull/16146]
--
Ticket URL: <https://code.djangoproject.com/ticket/34071>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070183a6943593-80363880-7966-485d-b680-41d4fd5d6988-000000%40eu-central-1.amazonses.com.