Commit Graph

215 Commits

Author SHA1 Message Date
Loic Bistuer 3a4c9e1b43 Cleaned up some forms tests.
Thanks Berker Peksag and Tim Graham for the reviews. Refs #24219.
2015-01-27 22:39:57 +07:00
Adam Taylor 039465a6a7 Fixed typos in code comments. 2015-01-20 12:18:03 -05:00
Tim Graham 33457cd3b0 Removed IPAddressField per deprecation timeline; refs #20439. 2015-01-19 11:12:57 -05:00
Tim Graham 714277cb4c Removed support for SplitDateTimeWidget with DateTimeField per deprecation timeline.
refs #8898
2015-01-17 18:49:44 -05:00
Tim Graham 37b7776a01 Removed django.utils.datastructures.MergeDict per deprecation timeline; refs #18659. 2015-01-17 08:13:36 -05:00
Tim Graham 9ce36512fa Removed backwards compatibility shims for "util" modules per deprecation timeline.
refs #17627.
2015-01-17 07:40:12 -05:00
Yang Liu 3f9ec12d9c Fixed #23712 -- Fixed KeyError with BaseForm._html_output() 2015-01-15 20:19:53 -05:00
Danilo Bargen 2e65d56156 Fixed #20003 -- Improved and extended URLValidator
This adds support for authentication data (`user:password`) in URLs,
IPv6 addresses, and unicode domains.

The test suite has been improved by adding test URLs from
http://mathiasbynens.be/demo/url-regex (with a few adjustments,
like allowing local and reserved IPs).

The previous URL validation regex failed this test suite on 13
occasions, the validator was updated based on
https://gist.github.com/dperini/729294.
2015-01-06 14:04:25 -05:00
Tim Graham 40a8504357 Fixed #23891 -- Moved deprecation of IPAddressField to system check framework.
Thanks Markus Holtermann for review.
2015-01-01 13:30:52 -05:00
Andrey Maslov 7a878ca5cb Fixed #24008 -- Fixed ValidationError crash with list of dicts. 2014-12-31 14:43:13 -05:00
Tim Graham 8a9b0c15a6 Renamed tests for util -> utils moves; refs #17627. 2014-12-31 11:26:27 -05:00
Claude Paroz 51890ce889 Applied ignore_warnings to Django tests 2014-12-30 18:16:25 +01:00
Marc Tamlyn 57554442fe Fixed #2443 -- Added DurationField.
A field for storing periods of time - modeled in Python by timedelta. It
is stored in the native interval data type on PostgreSQL and as a bigint
of microseconds on other backends.

Also includes significant changes to the internals of time related maths
in expressions, including the removal of DateModifierNode.

Thanks to Tim and Josh in particular for reviews.
2014-12-20 18:28:29 +00:00
Grzegorz Slusarek 0dea81cd6d Fixed #23674 -- Fixed a crash when a MultiValueField has invalid data. 2014-12-12 08:47:21 -05:00
Berker Peksag 560b4207b1 Removed redundant numbered parameters from str.format().
Since Python 2.7 and 3.1, "{0} {1}" is equivalent to "{} {}".
2014-12-03 14:27:38 -05:00
Tim Heap 5b17dcd8ef Fixed #23883 -- Stopped flatatt modifying its argument 2014-11-21 09:45:08 +01:00
Aymeric Augustin b69b4008d1 Removed usage of a global variable. 2014-11-19 21:35:40 +01:00
Peter Inglesby 74e1980cf9 Fixed #13181 -- Added support for callable choices to forms.ChoiceField
Thanks vanschelven and expleo for the initial patch.
2014-11-04 11:23:58 -05:00
Berker Peksag f7969b0920 Fixed #23620 -- Used more specific assertions in the Django test suite. 2014-11-03 11:56:37 -05:00
Loic Bistuer ec2fd02bb3 Fixed #23594 -- Fixed deepcopy on ErrorList.
Thanks Troy Grosfield for the report and Tim Graham for the tests.
2014-10-07 00:09:55 +07:00
Marc Tamlyn ed7821231b Fixed #19463 -- Added UUIDField
Uses native support in postgres, and char(32) on other backends.
2014-09-16 10:08:09 +01:00
Vlastimil Zíma e622caaa85 Fixed #21201 -- Improved customization of ClearableFileInput. 2014-08-29 09:40:08 -04:00
Tim Graham f9c7732e96 Tweaked docstrings from previous commit. 2014-08-22 15:57:15 -04:00
areski a6691e5dcf Fixed #23167 -- Added BaseForm.__repr__()
Thanks Keryn Knight for the idea.
2014-08-22 15:55:56 -04:00
Gabriel Muñumel deed00c0d8 Fixed #23162 -- Renamed forms.Field._has_changed() to has_changed(). 2014-08-15 08:14:45 -04:00
Tim Graham 6e77acc589 Fixed flake8 warning. 2014-08-03 14:21:45 -04:00
Tim Graham 0f2ceee025 Fixed #23151 -- Deprecated RegexField.error_message.
Thanks Baptiste Mispelon for the suggestion.
2014-08-03 11:21:01 -04:00
Petras Zdanavičius 8b7347220f Fixed #23103 -- Annotated ImageField file with image and content_type attributes.
Thanks Jeremy Dunck for the suggestion and Nick Sanford for review.
2014-08-01 09:30:58 -04:00
Kit La Touche 17e75d03f9 Fixed #23129 -- Added 'true' and 'false' to `NullBooleanField`.
JavaScript serializations of forms will sometimes render the boolean
values as the strings 'true' and 'false', in lower case. Rather than
repeat boilerplate in the JavaScript to circumvent this, it seems
reasonable to allow Django to understand the lower-case versions of the
booleans.
2014-07-29 19:55:55 -04:00
Simon Charette 80708ac772 Fixed #23113 -- ChoiceInput.render should take specified attrs into account.
Thanks to Tim Graham for the review.
2014-07-28 10:01:07 -04:00
Anubhav Joshi 5cdb8f8c1e Fixed #16617 -- Added 'value' to BaseValidator params.
Also allowed overriding the default messages in subclasses of BaseValidator.

Thanks sperrygrove for initial patch.
2014-07-26 10:03:00 -04:00
Anubhav Joshi 011abb7d96 Fixed #19671 -- Added warnings that null and validators are ignored for ManyToManyField.
Thanks Loic Bistuer and Tim Graham for help and review.
2014-07-09 16:01:09 -04:00
Claude Paroz dd9a23d5cf Fixed #22950 -- Eased markup customization for choice field rendering
Thanks Patrick Robertson for the report.
2014-07-05 13:36:49 +02:00
Claude Paroz 9209049211 Ensured bound field renders as unicode safe data
Refs #22950.
2014-07-05 11:42:27 +02:00
Loic Bistuer 1966054feb Fixed #22915 -- Document backward incompatible changes in the ValidationError constructor.
This patch also fixes update_error_dict to better handle the use case described
in this ticket, previously the type of the provided container could be lost in
some conditions.

Thanks Russell Keith-Magee for the report and Tim Graham for review.
2014-07-04 17:05:31 +07:00
gyx1000 7e2c87809c Fixed #22684 -- Amended SelectDateWidget.empty_label to accept a tuple of values.
Thanks danielsamuels for the report
2014-06-04 07:23:25 -04:00
Nick Presta 11f0899bbe Fixed #11776 -- Added CSS class for non-field/top of form errors.
Thanks Daniel Pope for the suggestion.
2014-06-02 15:22:15 -04:00
Alex Gaynor 1dcc603eff Fixed several typos in Django 2014-05-28 17:39:14 -07:00
Guillaume Pannatier 32586b0ba4 Fixed #22684 -- Added `empty_label` option on `django.forms.extras.widets.SelectDateWidget`
Thanks danielsamuels for the report
2014-05-28 13:23:28 -04:00
Florian Apolloner ee51ab9d23 Restored Python 2 compatibility. 2014-05-26 00:07:15 +02:00
Florian Apolloner 536ebaa048 Fixed a few warnings in the testsuite. 2014-05-25 23:14:50 +02:00
Stephen Burrows d64f192df1 Fixed #22628 -- Took initial forms into account when combining FormSet.min_num and FormSet.extra.
Forwardport of 79f15ab1ef from stable/1.7.x
2014-05-16 06:38:24 -04:00
Julen Ruiz Aizpuru 5eb81ce445 Fixed #22533 -- Added label_suffix parameter to form fields.
Fields can now receive the `label_suffix` attribute, which will override
a form's `label_suffix`.

This enhances the possibility to customize form's `label_suffix`, allowing
to use such customizations while using shortcuts such as
`{{ form.as_p }}`.

Note that the field's own customization can be overridden at runtime by
using the `label_prefix` parameter to `BoundField.label_tag()`.

Refs #18134.
2014-05-13 09:09:33 -04:00
Stephen Burrows a5de0df58b Fixed #22502 -- Fixed microseconds/default/form interaction
Made explicit lack of microsecond handling by built-in datetime form
fields. Used that explicitness to appropriately nix microsecond
values in bound fields. Thanks Claude Paroz for the review.
2014-05-10 10:56:39 +02:00
Ben Davis df60db0e78 Fixed #22570 -- Made Form.__getitem__ KeyError more descriptive. 2014-05-05 20:01:15 -04:00
chriscauley 66ec9ee441 Fixed #22378 -- Updated \d to [0-9]+ in urlpatterns of docs and tests.
Thanks tomwys for the suggestion.
2014-04-16 20:36:29 -04:00
Aymeric Augustin 2791fbf59d Used more specific test assertions. 2014-04-09 22:20:22 +02:00
Anubhav Joshi cd914e31c9 Fixed #21977 -- Deprecated SimpleTestCase.urls 2014-04-06 17:33:43 -04:00
Tim Graham d73d0e071c Fixed #22218 -- Deprecated django.conf.urls.patterns.
Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
2014-04-03 07:28:10 -04:00
Alex Gaynor 778ce245dd Corrected many style guide violations that the newest version of flake8 catches 2014-03-30 12:11:05 -07:00
Claude Paroz d320863878 Fixed #22114 -- Stopped adding trailing slashes in URLField.to_python
Thanks coredumperror at gmail.com for the report and Tim Graham
for the review.
2014-03-26 18:10:58 +01:00
Anubhav Joshi 416a858023 Fixed #17922 -- Added required_css_class to form label.
Thanks hanson2010 for the suggestion.
2014-03-24 08:11:54 -04:00
Loic Bistuer 7ac8380799 Fixed #22318 -- Added Form.has_error() to easily check if a given error has happened. 2014-03-24 07:21:32 -04:00
Loic Bistuer e61d99d96d Fixed #20684 -- Added support for HTML5 boolean attributes to form widgets. 2014-03-22 14:28:12 -04:00
Tim Graham e80de93af6 Removed hard-coded help_text for ManyToManyFields that use a SelectMultiple widget
Per deprecation timeline; refs #9321.
2014-03-21 19:10:07 -04:00
Tim Graham 35f46ec7a9 Fixed flake8 warnings. 2014-03-21 06:24:45 -04:00
Dejan Noveski 4d0c5f6142 Fixed #22255 -- Added support for specifying re flags in RegexValidator 2014-03-21 11:12:36 +01:00
Claude Paroz 5a976b4bec Fixed #22245 -- Avoided widget overwrite in forms.IntegerField subclasses
Thanks Jeroen Pulles for the report and Simon Charette for the review.
2014-03-13 16:58:14 +01:00
Claude Paroz 210d0489c5 Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
2014-03-08 09:57:40 +01:00
Chris Wilson 95c74b9d69 Fixed #22206 -- Passed models.TextField.max_length to forms.CharField.maxlength 2014-03-05 20:09:28 +01:00
Rodolfo Carvalho 0d91225892 Fixed many typos in comments and docstrings.
Thanks Piotr Kasprzyk for help with the patch.
2014-03-03 07:38:09 -05:00
vvojvoda c23b3717be Fixed #21962 -- Added escape_html flag to ErrorDict.as_json() 2014-02-28 07:05:55 -05:00
Claude Paroz cb844497d0 Fixed #22097 -- Fixed change detection for TypedChoiceField
Thanks Igor Mitrenko for the report.
2014-02-20 13:40:42 +01:00
Aymeric Augustin b951a7fbc1 Removed superfluous uses of TransRealMixin.
The translation.override context manager cleans up after itself. As a
consequence this mixin isn't needed any more in many cases.
2014-01-27 22:01:22 +01:00
Claude Paroz 0179852d7f Fixed #8898 -- Obsoleted SplitDateTimeWidget usage with DateTimeField
Thanks Tim Graham for the review.
2014-01-11 15:50:34 +01:00
Claude Paroz 18374c1d8c Fixed #21752 -- Prevented custom widget step attribute to be overwritten
Thanks orcein at gmail.com for the report.
2014-01-11 14:08:04 +01:00
Aymeric Augustin f5f7617167 Renamed a couple models to prevent duplicate names. 2014-01-05 20:52:46 +01:00
Aymeric Augustin e32095616c Imported override_settings from its new location. 2013-12-23 21:37:56 +01:00
Loic Bistuer 2fd7fc134c Refs #17413 -- Added isinstance backward compatibility on ErrorList. 2013-12-18 08:59:53 -05:00
Loic Bistuer 3ce9829b61 Fixed #17413 -- Serialization of form errors along with all metadata. 2013-12-16 16:33:28 -05:00
Loic Bistuer f563c339ca Fixed #20867 -- Added the Form.add_error() method.
Refs #20199 #16986.

Thanks @akaariai, @bmispelon, @mjtamlyn, @timgraham for the reviews.
2013-11-30 01:00:53 +07:00
Claude Paroz a0f3eeccf3 Fixed #21397 -- Re-added flexibility to TypedChoiceField coercion
Thanks Elec for the report and Simon Charette for the review.
2013-11-18 18:24:56 +01:00
Claude Paroz bc21e9c0d9 Fixed #13970 -- Made SelectDateWidget use the standard widget is_required attribute
Thanks mitar for the report and Tim Graham for the review.
2013-11-08 16:58:17 +01:00
Alex Gaynor f67e18f39e Fixed all E251 violations 2013-11-03 10:17:58 -08:00
Alex Gaynor c347f78cc1 Fixed all E226 violations 2013-11-03 10:08:55 -08:00
Jason Myers 7a61c68c50 PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02 23:50:49 -05:00
coagulant 8eec2d93b6 Fixed all E261 warnings 2013-11-02 23:50:33 -05:00
Tim Graham 36ded01527 Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
Alex Gaynor b35ff0d920 Fixed all the E203 violations 2013-10-26 18:27:42 -07:00
Alex Gaynor 9d740eb8b1 Fix all violators of E231 2013-10-26 12:15:03 -07:00
Alasdair Nicol c3aa2948c6 Fixed #21298 -- Fixed E301 pep8 warnings 2013-10-23 13:45:03 +01:00
Tim Graham ae48d77ef8 Fixed E225 pep8 warnings. 2013-10-23 06:09:29 -04:00
Ramiro Morales 51d2e1fb23 Fixed #21307 -- Moved TransRealMixin to django.test.utils. 2013-10-22 22:19:56 -03:00
Tim Graham 8e2029f8dd Removed import * in tests.
Thanks to flake8 path/to/file.py | awk -F ' ' '{ print $5 }' | sort | uniq
2013-10-22 08:32:01 -04:00
Alasdair Nicol b289fcf1bf Fixed #21288 -- Fixed E126 pep8 warnings 2013-10-21 08:31:30 -04:00
Tim Graham 96d1d4e292 Removed unused local variables in tests. 2013-10-19 08:31:38 -04:00
Alasdair Nicol a800036981 Fixed #21287 -- Fixed E123 pep8 warnings 2013-10-18 10:07:39 +01:00
Alasdair Nicol bab9123daa Fixed #21268 -- Fixed E303 pep8 warnings 2013-10-18 01:46:24 +01:00
Alasdair Nicol dfb4cb9970 Fixed #21285 -- Fixed E121,E122 pep8 warnings 2013-10-17 20:20:11 -04:00
Bouke Haarsma 2fb5a51fa3 Fixed #18659 -- Deprecated request.REQUEST and MergeDict
Thanks Aymeric Augustin for the suggestion.
2013-10-17 09:42:28 -04:00
Alasdair Nicol eb214452c3 Fixed #21270 -- Fixed E701 pep8 warnings 2013-10-17 12:12:40 +01:00
Marc Tamlyn ce823d3710 Merge pull request #1382 from loic/ticket19617
Fixed #19617 -- Refactored form metaclasses to support more inheritance scenarios.
2013-10-15 04:22:34 -07:00
Larry O'Neill 83b9bfea44 Fixed #21266 -- Fixed E201,E202 pep8 warnings. 2013-10-14 18:12:00 -04:00
Loic Bistuer ac5ec7b8bc Fixed #19617 -- Refactored Form metaclasses to support more inheritance scenarios.
Thanks apollo13, funkybob and mjtamlyn for the reviews.
2013-10-14 21:59:30 +07:00
Claude Paroz 00a73c1c69 Fixed #21173 -- Stopped fixing format for date-based widgets at init time
Thanks Marc Tamlyn for the review.
2013-10-12 18:31:19 +02:00
Tim Graham b67ab75e82 Fixed assorted flake8 errors. 2013-10-11 07:25:14 -04:00
Tim Graham adedc31072 Fixed "redefinition of unused 'foo' from line X" pyflakes warnings. 2013-10-10 11:09:42 -04:00
Tim Graham ff9e8eccf8 Removed unnecessary semicolons. 2013-10-10 08:50:32 -04:00
Christopher Babiak a834bc84d8 Fixed #20931 -- Fixed select widgets nested choice rendering
ChoiceFieldRenderer was not rendering nested choices. Added recursion
to ChoiceFieldRenderer to take nested choices and render them as
<ul>'s.
2013-09-28 17:25:32 -07:00
Erik Romijn 1a63092981 Fixed #20439 -- Started deprecation of IPAddressField 2013-09-28 10:55:32 +02:00