Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread Jacob Rief
On Wednesday, March 17, 2021 at 12:49:48 AM UTC+1 in...@markusholtermann.eu wrote: > That sounds like a sensible feature. Do you want to open a ticket and > maybe implement it? > Hi Markus, ticket #32559 has been issued to propose this feature. If

Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread Josh Smeaton
Just to clarify - you're talking about form fields rather than model fields, right? I can see the argument for form fields but not for model fields. Is there a better API we can think of for customising widgets from the field constructor that could then be passed through? As a rough example: m

Re: Query regarding Google Summer Of Code

2021-03-17 Thread Muskan Vaswan
Thank you so much, Ahmad. Heading your suggestion, I've put my question/ potential proposal up on the forum here . On Wednesday, 17 March 2021 at 09:51:48 UTC+5:30 Ahmad A. Hussein wrote: > Hello Muskan, > > "We're

Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread Carlton Gibson
Hiya, DecimalField already sets step based on the number of decimal places def test_decimalfield_widget_attrs(self): f = DecimalField(max_digits=6, decimal_places=2) self.assertEqual(f.widget_attrs(Widget()), {}) self.assertEqual(f.widget_attrs(NumberInput()), {'step

Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread Jacob Rief
> > 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 ma

Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread Carlton Gibson
> On 17 Mar 2021, at 15:34, Jacob Rief wrote: > > 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 consist

Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree that it makes sense to add the argument to FloatField so we can add the server-side validation logic. I would also like to see it on IntegerField for consistency, and since IntegerField also maps to a NumberInput. I'd also be against the widget_attributes proposal - there are already too m

Re: Proposal to add attribute 'step' to FloatField and DecimalField

2021-03-17 Thread Jacob Rief
Great News! So please accept ticket #32559 . I then will assign myself to it and implement it. So I add step (or would you prefer step_value?) to IntegerField and FloatField, but not to DecimalField (because there it's handled through decimal_places).

Django's build: Try Earthly?

2021-03-17 Thread Vlad A. Ionescu
Hi Django devs, Nick Pope directed me to this list. Wondering if anyone is interested in trying https://github.com/earthly/earthly for Django's build. Earthly could help with reproducing CI failures locally (via containers), testing against multiple versions of Python in parallel, or for migratin