>
> We set maxlength/minlength on widgets for CharFields *because they map 
> from an already existing kwarg*. 
>
> For the case of `step` on a FloatField we’d need to add a kwarg — but 
> that’s only there to set a single attribute on the widget. 
>
> But FloatField also offers a min_value and max_value. When rendered as a 
widget, they are used as attributes min and max in their input
field. In addition to that, the field value is validated against a value in 
that range. To be consistent, the same should apply to the step value.
This would  furthermore allow the field to validate against a multiple of 
that step value. Such a feature currently has to be implemented on the 
project level.

I agree with Carlton that in the DecimalField this is handled by the 
attribute decimal_places.

– Jacob

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e1402ecc-fa2b-47a8-ba79-f2d7f7f98f27n%40googlegroups.com.
  • Pro... Jacob Rief
    • ... Markus Holtermann
      • ... Jacob Rief
        • ... Josh Smeaton
          • ... Carlton Gibson
            • ... Jacob Rief
              • ... Carlton Gibson
                • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
                • ... Jacob Rief
                • ... Kapil Bansal
                • ... Jacob Rief
                • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
                • ... Jacob Rief
                • ... James Bennett
                • ... Kapil Bansal

Reply via email to