Commit Graph

61 Commits

Author SHA1 Message Date
Claude Paroz 7557207983 Fixed #20582 -- Allowed default Form.label_suffix to be translated
Thanks Tim Graham for the review.
2013-07-13 16:19:16 +02:00
Aymeric Augustin acd7b34aaf Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
Baptiste Mispelon 3128f3d38d Fixed #20618 -- Fixed regression in `BoundField.label_tag`. 2013-06-18 17:49:53 +02:00
Gabe Jackson 584bd14dcf Fixed #18134 -- BoundField.label_tag now includes the form's label_suffix
There was an inconsistency between how the label_tag for forms were
generated depending on which method was used: as_p, as_ul and as_table
contained code to append the label_suffix where as label_tag called on a
form field directly did NOT append the label_suffix. The code for
appending the label_suffix has been moved in to the label_tag code of
the field and the HTML generation code for as_p, as_ul and as_table now
calls this code as well.

This is a backwards incompatible change because users who have added the
label_suffix manually in their templates may now get double label_suffix
characters in their forms.
2013-06-10 14:23:15 -04:00
Ramiro Morales 0fa8d43e74 Replaced `and...or...` constructs with PEP 308 conditional expressions. 2013-05-26 23:47:50 -03:00
Claude Paroz be0bab1bb8 Fixed #11725 -- Made possible to create widget label tag without "for"
Thanks Denis Martinez for the report and initial patch, and
Sergey Kolosov for bringing the patch up to date.
2013-05-25 15:31:07 +02:00
Jeroen Dekkers d0788c2770 Fixed #18709 -- Check if initial_value is a callable
In _get_changed_data, check if initial_value is a callable and call it
if it is.
2013-05-22 01:05:22 +02:00
Aymeric Augustin 9c487b5974 Replaced an antiquated pattern.
Thanks Lennart Regebro for pointing it out.
2013-05-17 18:08:58 +02:00
Baptiste Mispelon ab686022f8 Fixed #20211: Document backwards-incompatible change in BoundField.label_tag
Also cleaned up label escaping and consolidated the test suite regarding
label_tag.
2013-04-12 10:17:17 +02:00
Claude Paroz cbfb8ed53b Fixed a regression in forms changed_data
Thanks Loic Bistuer for spotting the regression and the initial
patch. Refs #16612.
2013-03-08 18:19:24 +01:00
Claude Paroz 892bc91cb0 Fixed #16612 -- Improved has_changed detection for localized field values
Thanks Simon Charette for the review.
2013-03-01 09:35:04 +01:00
Claude Paroz 5eebb49c69 Fixed #19908 -- Added missing import in forms.py
Thanks loic84 for the report.
2013-02-24 22:59:15 +01:00
Simon Kerr 52533a64d5 fixed minor typo #19703 2013-01-30 19:48:05 +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 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
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
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
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
Aymeric Augustin bdca5ea345 [py3] Replaced unicode/str by six.text_type/bytes. 2012-07-22 09:29:54 +02:00
Aymeric Augustin d11d45aad9 [py3] Used six.with_metaclass wherever necessary. 2012-07-22 09:29:52 +02:00
Luke Plant 8fdc56d2a6 Fixed #18572 - Python26 string format incompatibility
Thanks to anonymous/AeroNotix for the report
2012-07-06 00:23:02 +01:00
Luke Plant a92e7f37c4 Changed a lot of internal code to use 'format_html' where appropriate/possible 2012-07-03 22:20:12 +01:00
Claude Paroz 4a103086d5 Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
2012-06-07 18:08:47 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Julien Phalip 3732c82f59 Made a minor tweak to a doctoring in `django/forms.forms.py` that was missed in r17452. Thanks to Claude Paroz for the tip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-05 08:12:07 +00:00
Alex Gaynor 477f4d8061 Clean up the form's code a little bit, to make it more consistantly go through one code path. Patch from Travis Swicegood.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17381 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-19 22:05:47 +00:00
Adrian Holovaty 08bec4fbc1 Changed BoundField.subwidgets() to return SubWidget objects instead of rendered strings. This means we can access individual radio buttons' properties in the template (see new docs)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-07 23:08:27 +00:00
Adrian Holovaty fc90c09efd Made BoundFields iterable, so that you can iterate over individual radio buttons of a RadioSelect in a template
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-07 22:31:39 +00:00
Paul McMillan 67565a5379 Remove comments referencing encryption. Django doesn't do encryption.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-18 20:28:52 +00:00
Alex Gaynor 1856e398c5 Remove more relative imports (I will kill them all).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17006 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-17 16:39:53 +00:00
Adrian Holovaty 13864703bc Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:11:19 +00:00
Russell Keith-Magee 74ffca17e2 Fixed #10573 -- Corrected autofocus problem in admin when the first widget displayed is a multiwidget. Thanks to rduffield for the report, and to Ramiro and Julien Phalip for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15452 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-08 12:00:21 +00:00
Chris Beaven d3f5f219f5 Fixes #10427 -- Abstract the value generation of a BoundField
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14734 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-28 02:50:31 +00:00
Jannis Leidel 392d992f82 Fixed #7048 -- Added ClearableFileInput widget to clear file fields. Thanks for report and patch, jarrow and Carl Meyer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-01 02:02:58 +00:00
Jannis Leidel 1df1378f9e Fixed #13827 -- Cleaned up a few unnecessary function calls.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-26 21:36:22 +00:00
Russell Keith-Magee b3dc3a0106 Fixed #13679, #13231, #7287 -- Ensured that models that have ForeignKeys/ManyToManyField can use a a callable default that returns a model instance/queryset. #13679 was a regression in behavior; the other two tickets are pleasant side effects. Thanks to 3point2 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-14 12:05:41 +00:00
Luke Plant 10906fa75d Fixed #8426 - 'helptext' CSS class - hopefully for real this time.
This file was missing from [13519]

Thanks to mattmcc for the catch.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13522 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-07 01:29:23 +00:00
Russell Keith-Magee c4b6edf3b8 Fixed #12746 -- Updated sorting calls to use 'key' instead of 'cmp'. This will be slightly faster in certain circumstances, but more importantly, is a required step for migration to Python 3. Thanks to Martin van Loewis for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13509 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06 16:31:44 +00:00
Jannis Leidel b057a8b247 Fixed #13560 -- Fixed localization of widgets.
Particularly this fixes the SplitDateTimeField and the AdminDateWidget by localizating the widget's value in its render method instead of the form field. Thanks to David Danier for the report and Russell for help with the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-21 14:07:54 +00:00
Jannis Leidel ca4c6f65ea Fixed #13032 - Added localize parameter to form fields to be able to selectively enable localization.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27 16:43:27 +00:00
Karen Tracey cc6e9b2286 Fixed #12434: Made pretty_name handle empty string and None as input. Thanks ales_zoulek and gabrielhurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-16 16:10:27 +00:00
Joseph Kocherhans b88f969789 Fixed #12960. The return value of ModelForm.clean() is now applied to the model. Thanks for the report, krejcik.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-06 18:42:56 +00:00
Joseph Kocherhans 408d431029 Fixed #12596. Calling super from a ModelForm's clean method is once again optional. Failing to call super only skips unique validation as documented. Thanks for the initial patch and tests, carljm.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-21 02:28:03 +00:00
Jannis Leidel 5e83b79d26 Fixed #12466 - Set HTML class attributes for each field separately. Thanks for the patch, Bernd Schlapsi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 22:51:03 +00:00
Joseph Kocherhans 471596fc1a Merged soc2009/model-validation to trunk. Thanks, Honza!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05 03:56:19 +00:00
Jacob Kaplan-Moss 574eafe4c0 Fixed #11753 - Q objects with callables no longer explode on Python 2.4. Thanks, Jeremy Dunck.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-17 22:06:41 +00:00
Jacob Kaplan-Moss 92803205cb Fixed #3512: it's now possible to add CSS hooks to required/erroneous form rows. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11830 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12 18:52:12 +00:00
Karen Tracey 9c4bd2aa33 Fixed #11632: Fixed the id for hidden initial widget so that it is different from the id for its visible counterpart. Thanks geber@datacollect.com and Mark Lavin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12 18:18:31 +00:00