I encountered a strange error with some code of mine which was due to some
label passed erroneously as positional parameter:
`distance = DecimalField("SomeLabel", max_digits=6, decimal_places=2)`
("SomeLabel" was passed as max_value, which only crashed when validating
the form with a strange comparison error).
I think that preventing positional parameters (with a lonely `*`) should
avoid this sort of unexpected errors. This might however be backwards
incompatible for previously well-functioning code.
--
Ticket URL: <https://code.djangoproject.com/ticket/28192>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
I think it's worth trying this -- we can always revert it and consider a
deprecation path if prerelease testing indicates major pain. I don't
recall encountering form fields using positional arguments during my time
working with Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/28192#comment:1>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8490 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28192#comment:2>
Comment (by GitHub <noreply@…>):
In [changeset:"8e752d84378c7169ef73a483ffffcba55a08c867" 8e752d84]:
{{{
#!CommitTicketReference repository=""
revision="8e752d84378c7169ef73a483ffffcba55a08c867"
Refs #28192 -- Made MultiValueField/ComboField fields argument required as
documented.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28192#comment:3>
Comment (by Claude Paroz <claude@…>):
In [changeset:"54caca2d34c7cb6807da0a82bcec7b3a679ac104" 54caca2]:
{{{
#!CommitTicketReference repository=""
revision="54caca2d34c7cb6807da0a82bcec7b3a679ac104"
Refs #28192 -- Fixed documentation of ChoiceField choices requirement
Thanks Tim Graham for noticing the issue.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28192#comment:4>
Comment (by Claude Paroz <claude@…>):
In [changeset:"81c3967e554716dbb5c86ebc390fd07389c39c2e" 81c3967e]:
{{{
#!CommitTicketReference repository=""
revision="81c3967e554716dbb5c86ebc390fd07389c39c2e"
[1.11.x] Refs #28192 -- Fixed documentation of ChoiceField choices
requirement
Thanks Tim Graham for noticing the issue.
Backport of 54caca2d34c7cb6807da0a82bcec7b3a679ac104 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28192#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"43b574007ef5edfe11f3b899fbe0a6fc05c43774" 43b57400]:
{{{
#!CommitTicketReference repository=""
revision="43b574007ef5edfe11f3b899fbe0a6fc05c43774"
Fixed #28192 -- Required passing optional form field args as keyword args.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28192#comment:6>