summaryrefslogtreecommitdiff
path: root/django/forms/forms.py
AgeCommit message (Collapse)Author
2013-10-14Fixed #19617 -- Refactored Form metaclasses to support more inheritance ↵Loic Bistuer
scenarios. Thanks apollo13, funkybob and mjtamlyn for the reviews.
2013-09-21Ensured that BoundField.as_widget always returns properly localized fields.Florian Apolloner
This is a follow-up to #18777 which improperly converted to strings in prepare_value and as such caused regressions like #21074. Refs #18777, #21074
2013-09-16Fixed #17627 -- Renamed util.py files to utils.pyTim Graham
Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.
2013-09-10Fixed #5749 -- Added field_name as a key in the _html_output dicte0ne
Thanks SmileyChris for the suggestion.
2013-08-22Moved translator comment just above the target stringClaude Paroz
2013-08-13Fixed #20555 -- Make subwidget id attribute availableMatt Johnson
In `BoundField.__iter__`, the widget's id attribute is now passed to each subwidget. A new id_for_label property was added to ChoiceInput.
2013-08-08Revert change to the default Form.clean()Marc Tamlyn
This means it doesn't break for people who are doing `cleaned_data = super(FooForm, self).clean()`.
2013-08-08Form.clean() does not need to return cleaned_data.Marc Tamlyn
If it does, that will be used as the cleaned_data. The default implementation has been changed to match this change.
2013-08-04Deprecated SortedDict (replaced with collections.OrderedDict)Curtis Maloney
Thanks Loic Bistuer for the review.
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-07-26Fixed #20805 -- Removed an extra colon beside checkboxes in the admin.Tim Graham
Thanks CollinAnderson for the report.
2013-07-13Fixed #20582 -- Allowed default Form.label_suffix to be translatedClaude Paroz
Thanks Tim Graham for the review.
2013-06-29Advanced deprecation warnings for Django 1.7.Aymeric Augustin
2013-06-18Fixed #20618 -- Fixed regression in `BoundField.label_tag`.Baptiste Mispelon
2013-06-10Fixed #18134 -- BoundField.label_tag now includes the form's label_suffixGabe Jackson
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-05-26Replaced `and...or...` constructs with PEP 308 conditional expressions.Ramiro Morales
2013-05-25Fixed #11725 -- Made possible to create widget label tag without "for"Claude Paroz
Thanks Denis Martinez for the report and initial patch, and Sergey Kolosov for bringing the patch up to date.
2013-05-22Fixed #18709 -- Check if initial_value is a callableJeroen Dekkers
In _get_changed_data, check if initial_value is a callable and call it if it is.
2013-05-17Replaced an antiquated pattern.Aymeric Augustin
Thanks Lennart Regebro for pointing it out.
2013-04-12Fixed #20211: Document backwards-incompatible change in BoundField.label_tagBaptiste Mispelon
Also cleaned up label escaping and consolidated the test suite regarding label_tag.
2013-03-08Fixed a regression in forms changed_dataClaude Paroz
Thanks Loic Bistuer for spotting the regression and the initial patch. Refs #16612.
2013-03-01Fixed #16612 -- Improved has_changed detection for localized field valuesClaude Paroz
Thanks Simon Charette for the review.
2013-02-24Fixed #19908 -- Added missing import in forms.pyClaude Paroz
Thanks loic84 for the report.
2013-01-30fixed minor typo #19703Simon Kerr
2013-01-26Fixed #18483 -- Marked hidden field error string for translationClaude Paroz
Thanks Evil Clay for the report and Emil Stenstrom for the initial patch.
2013-01-25Used property decorators in django/forms.pyClaude Paroz
2013-01-25Moved has_changed logic from widget to form fieldClaude Paroz
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2012-08-12[py3] Refactored __unicode__ to __str__.Aymeric Augustin
* 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-07[py3] Ported django.utils.encoding.Aymeric Augustin
* 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[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-08-04Fixed #5524 -- Do not remove cleaned_data when a form fails validationClaude Paroz
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-07-22[py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin
2012-07-22[py3] Used six.with_metaclass wherever necessary.Aymeric Augustin
2012-07-06Fixed #18572 - Python26 string format incompatibilityLuke Plant
Thanks to anonymous/AeroNotix for the report
2012-07-03Changed a lot of internal code to use 'format_html' where appropriate/possibleLuke Plant
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-04-29Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-02-05Made a minor tweak to a doctoring in `django/forms.forms.py` that was missed ↵Julien Phalip
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-01-19Clean up the form's code a little bit, to make it more consistantly go ↵Alex Gaynor
through one code path. Patch from Travis Swicegood. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17381 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-07Changed BoundField.subwidgets() to return SubWidget objects instead of ↵Adrian Holovaty
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-07Made BoundFields iterable, so that you can iterate over individual radio ↵Adrian Holovaty
buttons of a RadioSelect in a template git-svn-id: http://code.djangoproject.com/svn/django/trunk@17173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-18Remove comments referencing encryption. Django doesn't do encryption.Paul McMillan
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-17Remove more relative imports (I will kill them all).Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17006 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28Removed a bunch more Python 2.4 workarounds now that we don't support that ↵Adrian Holovaty
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-02-08Fixed #10573 -- Corrected autofocus problem in admin when the first widget ↵Russell Keith-Magee
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
2010-11-28Fixes #10427 -- Abstract the value generation of a BoundFieldChris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14734 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-01Fixed #7048 -- Added ClearableFileInput widget to clear file fields. Thanks ↵Jannis Leidel
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-09-26Fixed #13827 -- Cleaned up a few unnecessary function calls.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-14Fixed #13679, #13231, #7287 -- Ensured that models that have ↵Russell Keith-Magee
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-07Fixed #8426 - 'helptext' CSS class - hopefully for real this time.Luke Plant
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