Commit Graph

346 Commits

Author SHA1 Message Date
Simon Charette a097ee32d8 Fixed #17683 -- Make sure `BaseModelFormSet` respects defined widgets. 2013-02-05 05:39:35 -05:00
Claude Paroz 5b4805ae2b Merge pull request #686 from skrr/ticket_19703
Fixed #19703 -- Typo in get_declared_fields docstring
2013-01-30 13:29:56 -08:00
Claude Paroz fc8efc2d9e Fixed #19034 -- Added proper i18n pluralization for max/min length validation messages
This was made possible by commit 3f1a0c0040. Thanks Evil Clay
for the report and Alexey Boriskin his work on the ticket.
2013-01-30 21:44:14 +01:00
Simon Kerr 52533a64d5 fixed minor typo #19703 2013-01-30 19:48:05 +01:00
Claude Paroz f7394d2c32 Added HTML5 url input type
Refs #16630.
2013-01-28 22:11:00 +01:00
Claude Paroz 4f16376274 Added HTML5 email input type
Refs #16630.
2013-01-28 22:10:50 +01:00
Claude Paroz 4b3f7110ae Fixed #16123 -- Ensured strptime receive proper string type
strptime generates an UnicodeEncodeError when using a non-ascii
unicode string on Python 2.
2013-01-26 20:53:09 +01:00
Claude Paroz 962f133f72 Fixed #18483 -- Marked hidden field error string for translation
Thanks Evil Clay for the report and Emil Stenstrom for the initial
patch.
2013-01-26 19:59:44 +01:00
Claude Paroz d18893d5ce Moved BooleanField 'required' validation in validate() 2013-01-26 16:45:29 +01:00
Claude Paroz 58062a6302 Used property decorators in django/forms.py 2013-01-25 22:41:45 +01:00
Claude Paroz ebb504db69 Moved has_changed logic from widget to form field
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2013-01-25 20:50:46 +01:00
Nick Sandford 93e79b45bc Fixed #17416 -- Added widgets argument to inlineformset_factory and modelformset_factory 2013-01-24 08:58:17 +01:00
Anssi Kääriäinen 3647c0a49a Avoided unnecessary recreation of RelatedObjects
Refs #19399. Thanks to Track alias KJ for the patch.
2013-01-18 07:09:39 +02:00
Aymeric Augustin 4cf057faab Removed obsolete comment.
These features are implemented, tracked in tickets, or not necessary.

Thanks Bruno Renié.
2013-01-15 18:02:24 +01:00
Tim Graham 71d76ec011 Fixed #10239 - Added docs for modelform_factory
Thanks ingenieroariel for the suggestion and slurms for the review.
2013-01-11 06:00:19 -05:00
Loic Raucy 62f842e2e5 Fixed #19581 -- ensure unique html ids with CheckboxSelectMultiple widgets
ID check is now done the same way as MultipleHiddenInput.
2013-01-09 16:06:56 -08:00
Simon Charette 3fc43c964e Fixed #19545 -- Make sure media/is_multipart work with empty formsets 2013-01-03 15:16:23 +01:00
Claude Paroz 884f77bd15 Removed unusable parameters to empty_form property 2013-01-01 21:00:52 +01:00
Claude Paroz d11038acb2 Fixed #19537 -- Made CheckboxInput._has_changed handle 'False' string
Thanks dibrovsd@gmail.com for the report.
2012-12-31 10:18:59 +01:00
Aymeric Augustin e9c24bef74 Fix #19524 -- Incorrect caching of parents of unsaved model instances.
Thanks qcwxezdas for the report. Refs #13839.
2012-12-28 23:34:54 +01:00
Ian Clelland 6b9f130278 Sort HTML attributes on generated forms 2012-12-24 00:47:17 +00:00
Patryk Zawadzki 3989ce52ef Fixed #18172 -- Made models with __iter__ usable in ModelMultipleChoiceField
Thanks to Patryk Zawadzki for the patch.
2012-12-19 22:51:12 +02:00
Andreas Hug 66dfcc10b3 Fixed #18574 -- Make BaseFormSet.is_valid call its underlying forms' is_valid
Thanks Simon Charette for the report and the initial patch.
2012-12-06 20:00:56 +01:00
Claude Paroz 78f66691ee Fixed #8627 -- Prevented textareas to swallow first newline content
Browsers consider the first newline in textareas as some display
artifact, not real content. Hence they are not sending it back to
the server. If we want to keep initial newlines, we have to add one
when we render the textarea.
Thanks bastih for the report and initial patch.
2012-11-05 20:27:06 +01:00
Anton I. Sipos e44ab5bb4f Fixed #18949 -- Improve performance of model_to_dict with many-to-many
When calling model_to_dict, improve performance of the generated SQL by
using values_list to determine primary keys of many to many objects. Add
a specific test for this function, test_model_to_dict_many_to_many

Thanks to brian for the original report and suggested fix.
2012-11-04 15:52:05 -08:00
Aymeric Augustin fc10418fba Fixed #18963 -- Used a subclass-friendly pattern
for Python 2 object model compatibility methods.
2012-11-03 22:07:35 +01:00
Claude Paroz be29329ccd Fixed #16820 -- Treated '0' value as True for checkbox inputs
Thanks Dan Fairs for the report and the initial patch.
2012-10-26 20:44:00 +02:00
Ludovic Delaveau 7a44dc555a Fixed #16479 - Forms generated from formsets use ErrorList instead of supplied error_class
Patch with tests from charettes, updated.
2012-10-13 15:28:20 +01:00
Stephen Burrows 218abcc9e5 Fixed #14567 -- Made ModelMultipleChoiceField return EmptyQuerySet as empty value 2012-10-03 20:47:35 +03:00
Adrien Lemaire 2c8267bf3d Fixed #17899 -- Rewrote [Ee]-mail to [Ee]mail 2012-09-26 14:14:51 +02:00
Aymeric Augustin 3174b5f2f5 Fixed #18982 - Caught TypeError in DateField.clean
Thanks gwahl at fusionbox com.
2012-09-23 13:27:01 +02:00
Claude Paroz f1bdfbd24b Document and test 'type' usage in Widget attrs
Refs #16630.
2012-09-10 19:31:11 +02:00
Alex Gaynor 6a5a12ea3e Fixed #17888 -- no longer silence exceptions inside of check_test. Thanks to brutasse for the patch. 2012-09-07 14:37:21 -04:00
Claude Paroz 39aa8901e1 Made use of property decorator in formsets.py 2012-09-06 23:08:15 +02:00
Claude Paroz fb3d916c20 Fixed #18751 -- Cleaned up BaseFormSet._should_delete_form
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.
2012-08-30 15:51:13 +02:00
Aymeric Augustin 5301a9d7b1 [py3] Removed duplicate imports.
Fixed #18837. Refs #18791.
2012-08-23 10:16:16 +02:00
Alexey Boriskin abc4038b0b Fixed #18791: [py3] Double import of six in django.forms.widgets 2012-08-18 19:17:42 +04:00
Aymeric Augustin e091c18f50 [py3] Removed a remaining use of __metaclass__. 2012-08-14 23:45:12 +02:00
Claude Paroz 5e958b958b [py3] Avoided comparison with None value in formsets 2012-08-13 11:54:13 +02:00
Aymeric Augustin d4a0b27838 [py3] Refactored __unicode__ to __str__.
* 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
2012-08-12 14:44:40 +02:00
Claude Paroz db729266d6 [py3] Fixed 'iterable but non string' detection
In Python 3, the str type has an __iter__ attribute. Therefore, the
presence of an __iter__ attribute is not sufficient to distinguish
'standard' iterables (list, tuple) from strings.
2012-08-08 18:02:25 +02:00
Claude Paroz 576ec12f8e [py3] Replaced __nonzero__ by __bool__
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
2012-08-08 15:02:31 +02:00
Aymeric Augustin c5ef65bcf3 [py3] Ported django.utils.encoding.
* Renamed smart_unicode to smart_text (but kept the old name under
  Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
  and smart_bytes under Python 2 (which is backwards compatible).
  Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
  want a str.
2012-08-07 12:00:22 +02:00
Aymeric Augustin ee191715ea [py3] Fixed access to dict keys/values/items. 2012-08-07 12:00:22 +02:00
Alex Gaynor ede49c7ee0 Fixed #15754 -- avoid recursively computing the tree of media widgets more times than is necessary for a wiget 2012-08-06 07:59:59 -07:00
Claude Paroz 121fd109de Fixed #5524 -- Do not remove cleaned_data when a form fails validation
cleaned_data is no longer deleted when form validation fails but only
contains the data that did validate.
Thanks to the various contributors to this patch (see ticket).
2012-08-04 14:22:23 +02:00
Claude Paroz 9908201d7f Replaced some byte strings by str() calls
This is a useful trick when Python 2 awaits byte strings and
Python 3 Unicode (regular) strings.
2012-08-03 15:18:13 +02:00
Florian Apolloner b1d4634686 Fixed second security issue in image uploading. Disclosure and release forthcoming. 2012-07-30 21:57:22 +02:00
Piet Delport 487b92a13c it's -> its 2012-07-25 01:21:15 +02:00
Aymeric Augustin a84d79f572 [py3] Added Python 3 compatibility for xrange. 2012-07-22 09:29:56 +02:00