Re: [Django] #35435: NumberInput off-by-one on min value for type range

2024-05-05 Thread Django
#35435: NumberInput off-by-one on min value for type range
---+--
 Reporter:  mitch99|Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Forms  |  Version:  5.0
 Severity:  Normal |   Resolution:  duplicate
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+--
Changes (by mitch99):

 * resolution:   => duplicate
 * status:  new => closed

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f4a297cf9-4b20d926-15a3-4984-a5af-e8468a2f495d-00%40eu-central-1.amazonses.com.


[Django] #35435: NumberInput off-by-one on min value for type range

2024-05-05 Thread Django
#35435: NumberInput off-by-one on min value for type range
-+
   Reporter:  mitch99|  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Forms  |Version:  5.0
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+
 Follow-up to #35433 which was closed (and I couldn't reopen):

 {{{
 class ContentProfileDefinitionForm(forms.ModelForm):
 class Meta:
 model = ContentProfileDefinition
 fields = ["other", "weight"]
 widgets = {
 "weight": forms.NumberInput(
 attrs={
 "type": "range",
 "step": "1",
 "min": "1",
 "max": "5",
 }
 ),
 }

 class ContentProfileDefinition(models.Model):
 other = models.ForeignKey("Other", on_delete=models.CASCADE)
 weight = models.PositiveSmallIntegerField(
 default=1,
 help_text="Weight",
 validators=[
 MinValueValidator(1),
 MaxValueValidator(5),
 ],
 )

 }}}

 I expect the min value on the range input to be 1, but it's actually 0:

 {{{
 

 }}}
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f4a287874-2dff6d17-e14e-45dc-9dc7-a947afef797b-00%40eu-central-1.amazonses.com.