#34826: Bounded Integer Range Field For Forms
-------------------------------------+-------------------------------------
Reporter: Atufa | Owner: Atufa Shireen
Shireen |
Type: New | Status: assigned
feature |
Component: Forms | Version: 4.2
Severity: Normal | Keywords: Forms,
| IntegerField, BoundedField,
Triage Stage: | RangeField
Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
**Overview:**
There are fields in Django like integer range where lower bound is
included but the upper bound is excluded. Therefore, the goal of this
ticket is to introduce a new form field, BoundedRangeField, that extends
Django's IntegerField to allow the creation of custom integer range fields
in forms. This field will be particularly useful when you need to specify
a specific range of integers for input in your forms.
**Usage:**
To use the BoundedRangeField, developers will be able to specify the
minimum and maximum values for the integer range when defining form
fields. For example:
{{{
my_field = BoundedRangeField(min_val=0, max_val=100)
}}}
This will create a form field that accepts integers between 0 and 100.
**Additional Notes:**
The proposed BoundedRangeField is designed to align with Django's form
field conventions and maintain compatibility with database-related
functionality.
Testing and documentation updates will be necessary to ensure proper
integration and usage of this new field.
Please feel free to review and provide feedback on this proposal. Once the
proposal is accepted, I will proceed with implementing the feature and
submitting a pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/34826>
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/0107018a7bb64ef4-6cdbd969-259d-4175-a294-35ab4f621cd8-000000%40eu-central-1.amazonses.com.