| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
By specifying form_kwargs when instantiating the formset, or overriding
the `get_form_kwargs` method on a formset class, you can pass extra
keyword arguments to the underlying `Form` instances.
Includes tests and documentation update.
|
|
|
|
| |
elements in non-Django templates.
|
| |
|
|
|
|
| |
imports to range
|
|
|
|
|
|
| |
combining FormSet.min_num and FormSet.extra.
Forwardport of 79f15ab1ef from stable/1.7.x
|
| |
|
|
|
|
| |
version of flake8 catches
|
|
|
|
| |
Thanks Piotr Kasprzyk for help with the patch.
|
|
|
|
| |
all metadata.
|
| |
|
|
|
|
| |
django.forms.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Thanks gsf for the suggestion.
|
|
|
|
|
| |
Thanks PaulM for the suggestion and Luke Granger-Brown and
Wiktor Kołodziej for the initial patch.
|
|
|
|
| |
unused imports and local variables
|
|
|
|
| |
comprehensions.
|
|
|
|
|
| |
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
|
|
|
|
|
|
|
|
| |
BaseModelFormSet init
BaseModelFormSet.forms is now a cached property instead of being
populated in the __init__ method. This behaviour also matches an
example in the documentation.
Thanks Thomasz Swiderski for the report and Simon Charette for the
review.
|
| |
|
|
|
|
| |
error_messages from model fields
|
|
|
|
|
|
| |
formsets.
Thanks to frog32 for the report and to Tim Graham for the review.
|
|
|
|
| |
validating max_num.
|
|
|
|
|
|
|
| |
non_form_errors
Updated FormSet.non_form_errors() to ensure full_clean() has
been called before returning the errors.
|
|
|
|
| |
Thanks Lennart Regebro for pointing it out.
|
|
|
|
|
| |
Several languages will distinctly translate '%d or fewer forms'
depending on the variable.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
max_num on server.
This is provided as a new "validate_max" formset_factory option defaulting to
False, since the non-validating behavior of max_num is longstanding, and there
is certainly code relying on it. (In fact, even the Django admin relies on it
for the case where there are more existing inlines than the given max_num). It
may be that at some point we want to deprecate validate_max=False and
eventually remove the option, but this commit takes no steps in that direction.
This also fixes the DoS-prevention absolute_max enforcement so that it causes a
form validation error rather than an IndexError, and ensures that absolute_max
is always 1000 more than max_num, to prevent surprising changes in behavior
with max_num close to absolute_max.
Lastly, this commit fixes the previous inconsistency between a regular formset
and a model formset in the precedence of max_num and initial data. Previously
in a regular formset, if the provided initial data was longer than max_num, it
was truncated; in a model formset, all initial forms would be displayed
regardless of max_num. Now regular formsets are the same as model formsets; all
initial forms are displayed, even if more than max_num. (But if validate_max is
True, submitting these forms will result in a "too many forms" validation
error!) This combination of behaviors was chosen to keep the max_num validation
simple and consistent, and avoid silent data loss due to truncation of initial
data.
Thanks to Preston for discussion of the design choices.
|
|
|
|
|
|
| |
a formset.
This is a security fix. Disclosure and advisory coming shortly.
|
|
|
|
|
|
| |
validate_unique
Thanks c.pollock at bangor.ac.uk for the report.
|
|
|
|
| |
empty formsets
|
| |
|
|
|
|
|
|
| |
underlying forms' is_valid
Thanks Simon Charette for the report and the initial patch.
|
|
|
|
| |
for Python 2 object model compatibility methods.
|
|
|
|
|
|
| |
ErrorList instead of supplied error_class
Patch with tests from charettes, updated.
|
| |
|
|
|
|
|
|
| |
We can do that now that cleaned_data is guaranteed to be
present. Related to [121fd109].
Thanks Simon Charette for his work on the ticket.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Renamed the __unicode__ methods
* Applied the python_2_unicode_compatible decorator
* Removed the StrAndUnicode mix-in that is superseded by
python_2_unicode_compatible
* Kept the __unicode__ methods in classes that specifically
test it under Python 2
|
|
|
|
| |
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
|
|
|
|
|
| |
This is a useful trick when Python 2 awaits byte strings and
Python 3 Unicode (regular) strings.
|
| |
|
| |
|
|
|
|
|
|
|
| |
compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
|
|
|
|
|
| |
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
|