1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00
Commit Graph

29824 Commits

Author SHA1 Message Date
Wu Haotian
65b880b726 Fixed #32930 -- Fixed URLValidator when port numbers < 10. 2021-07-22 11:58:28 +02:00
Wu Haotian
b96cc7f85e Added more test cases with port numbers for URLValidator. 2021-07-22 11:58:28 +02:00
Mariusz Felisiak
83022d279c
Refs #32508 -- Raised TypeError/ValueError instead of using "assert" in encode() methods of some password hashers. 2021-07-22 09:42:07 +02:00
Nick Pope
c35b81b864 Fixed #32951 -- Removed Query.where_class & co.
Unused since 3caf957ed5.
2021-07-22 08:49:20 +02:00
Carlton Gibson
012f38f959 Refs #32949 -- Adjusted release note wording. 2021-07-21 11:34:47 +02:00
yakimka
c542d0a072 Fixed #32949 -- Restored invalid number handling in DecimalField.validate().
DecimalField must itself validate() values, such as NaN, which cannot be
passed to validators, such as MaxValueValidator, during the
run_validators() phase.

Regression in cc3d24d7d5.
2021-07-21 10:20:24 +02:00
David Wobrock
fd999318ad Fixed #32704 -- Fixed list of deferred fields when chaining QuerySet.defer() after only(). 2021-07-20 12:15:29 +02:00
David Wobrock
96706d76cd Added more tests for chaining QuerySet.defer() after only(). 2021-07-20 12:14:28 +02:00
Keryn Knight
6a970a8b46
Fixed #32944 -- Avoided unnecessary WhereNode.add() calls.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-20 11:59:21 +02:00
Keryn Knight
ff661dbd50 Refs #32940 -- Removed unnecessary branch in Node.add().
The "data in self.children" branch was causing data.__eq__ to be
called for each entries in "self.children" which resulted in a huge
slowdown during queryset construction.

It's purpose was to prevent queries of the form
    Model.objects.filter(foo='bar').filter(foo='bar')
from resulting in
    WHERE foo='bar' AND foo='bar'
but it's not covered by the suite and has arguable performance benefits
since it's not very common and SQL engines are usually very good at
folding/optimizing these.

See also #32632 for prior discussion around comparing data to the
Node's children.

Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2021-07-20 07:19:28 +02:00
Keryn Knight
fb35e0a2fe Refs #32940 -- Removed Node.add()'s unused squash parameter.
Unused since its introduction in d3f00bd570.

Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2021-07-20 07:19:28 +02:00
Nick Pope
fee8734596 Refs #10929 -- Deprecated forced empty result value for PostgreSQL aggregates.
This deprecates forcing a return value for ArrayAgg, JSONBAgg, and
StringAgg when there are no rows in the query. Now that we have a
``default`` argument for aggregates, we want to revert to returning the
default of ``None`` which most aggregate functions return and leave it
up to the user to decide what they want to be returned by default.
2021-07-19 13:41:16 +02:00
Nick Pope
501a8db465 Fixed #10929 -- Added default argument to aggregates.
Thanks to Simon Charette and Adam Johnson for the reviews.
2021-07-19 13:04:27 +02:00
Keryn Knight
59942a66ce Fixed #32941 -- Removed get_format_modules()'s unused reverse argument.
Unused since 0d8b523422.
2021-07-19 11:42:20 +02:00
Nick Pope
37ec8721df
Fixed #32942 -- Confirmed support for PostGIS 3.1. 2021-07-19 06:49:41 +02:00
Nick Pope
e21daa4e4c
Removed unnecessary tuple construction in Node.__eq__(). 2021-07-19 06:38:35 +02:00
Chris Jerdonek
f3825ee050
Fixed wording of AuthViewsTestCase's docstring. 2021-07-19 06:36:20 +02:00
Jacob Walls
66058c5758 Fixed typo in docs/ref/databases.txt. 2021-07-19 06:10:34 +02:00
Jacob Walls
56f9579105 Fixed #32655 -- Deprecated extra_tests argument for DiscoverRunner.build_suite()/run_tests(). 2021-07-16 20:46:41 +02:00
Jacob Walls
00c724f2f2
Fixed typo in docs/releases/3.1.13.txt. 2021-07-16 20:30:21 +02:00
Haki Benita
59404e8cfe Fixed typo in docs/topics/signals.txt. 2021-07-16 20:25:36 +02:00
Chris Jerdonek
0dc25526d8 Fixed #32924 -- Changed BaseForm.get_initial_for_field() to remove microseconds when needed. 2021-07-16 15:51:20 +02:00
Chris Jerdonek
788441c6ab Refs #32924 -- Changed test_initial_datetime_values() to use subTests. 2021-07-16 15:51:20 +02:00
Chris Jerdonek
469e769299 Refs #32924 -- Changed test_get_initial_for_field() to use subTests. 2021-07-16 15:51:20 +02:00
Nick Pope
304f6ff46a
Prevented SQLCompiler.execute_sql() from closing cursor twice.
cursor_iter() helper calls cursor.close() in a finally block.
2021-07-16 13:11:46 +02:00
David Smith
f51a792c41
Fixed #32928 -- Confirmed support for GDAL 3.3. 2021-07-16 09:36:53 +02:00
Jacob Walls
10f66c91cb
Fixed typo in docs/internals/deprecation.txt. 2021-07-16 06:00:22 +02:00
Mariusz Felisiak
a56531ab1b
Fixed #32910 -- Unified different plural equations for the same language in contrib apps.
Thanks Martin Svoboda for the report and initial patch.
2021-07-15 20:42:17 +02:00
pochangl
f6d3557aa1
Fixed #32929 -- Fixed handling query strings in AsyncRequestFactory. 2021-07-15 13:09:29 +02:00
Daniyal
f479df7f8d Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.db.models.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-15 11:43:33 +02:00
Chris Jerdonek
08f0778885 Refs #32920 -- Added BoundField._has_changed() for use in BaseForm.changed_data(). 2021-07-15 10:47:02 +02:00
Chris Jerdonek
90a33ab2ce Fixed #32920 -- Changed BaseForm to access its values through bound fields. 2021-07-15 10:47:02 +02:00
Ties Jan Hefting
84400d2e9d Fixed #32905 -- Added CSS class for non-form errors of formsets. 2021-07-15 07:00:39 +02:00
Nick Pope
7f33c1e22d
Added note about zero timeout in cache settings docs. 2021-07-14 20:28:21 +02:00
ᴙɘɘᴙgYmɘᴙɘj
5838102ae6
Fixed typo in docs/internals/contributing/committing-code.txt. 2021-07-14 20:21:26 +02:00
Carlton Gibson
3a45fea083 Fixed #21936 -- Allowed DeleteView to work with custom Forms and SuccessMessageMixin.
Thanks to Mariusz Felisiak for review.

Co-authored-by: Demetris Stavrou <demestav@gmail.com>
Co-authored-by: Caroline Simpson <github@hoojiboo.com>
2021-07-14 09:47:03 +02:00
Mariusz Felisiak
37e8367c35
Refs #31676 -- Removed Django Core-Mentorship mailing list references in docs. 2021-07-13 20:21:22 +02:00
Nick Pope
1f4908b01a Simplified django.utils.dateformat methods.
This removes unnecessary format('O') call, remove unnecessary method
calls for simple cases in TimeFormat, and simplifies time zone handling
in TimeFormat.
2021-07-13 13:27:01 +02:00
Nick Pope
6afc2a944c Completed test coverage for django.utils.dateformat. 2021-07-13 13:21:10 +02:00
Nick Pope
ab0d751ddf Used subTest() in utils_tests.test_dateformat. 2021-07-13 13:06:48 +02:00
Hasan Ramezani
f5669fd7b5 Fixed #32899 -- Added note about avoiding non-dict objects in JsonResponse docs.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-13 10:25:03 +02:00
Daniele Procida
22fbebc744
Refs #32880 -- Made some titles consistent in how-to documents.
This retitles documents for consistency, since some already (correctly)
begin "How to...".
2021-07-13 09:25:37 +02:00
Chris Jerdonek
4be58fcc36
Fixed #32917 -- Added BaseForm._widget_data_value()/_field_data_value(). 2021-07-13 06:32:46 +02:00
Wilhelm Klopp
bbf93efa19
Refs #23359 -- Corrected showmigrations help text for the --database option. 2021-07-13 06:29:21 +02:00
Mariusz Felisiak
0250340e37
Refs #32074 -- Used Enum.repr() format proposed for Python 3.10.
The Python's Steering Council decided to revert changes in the Enum
module (see https://bugs.python.org/issue44559) and moved them to
Python 3.11.

Follow up to 5d9b065d3f.

Thanks Nick Pope for the review.
2021-07-12 11:46:37 +02:00
Daniele Procida
013a1824d3 Refs #32880 -- Created a new logging how-to document.
Moved how-to material from topic document into a new document, and
added new material. Introduced minor improvements to logging
reference document.
2021-07-12 09:04:25 +02:00
Chris Jerdonek
5848b3a1d7 Fixed #32914 -- Prevented test --shuffle from skipping test methods.
"test --shuffle" skipped test methods when test classes were mixed.
This changes runner.py's reorder_tests() to group by TestCase class.

Regression in 90ba716bf0.
2021-07-12 06:36:12 +02:00
Wille Marcel
6f60fa97b0
Fixed typo in docs/ref/contrib/gis/tutorial.txt. 2021-07-09 20:17:16 +02:00
Ian Foote
f42ccdd835 Fixed #27021 -- Allowed lookup expressions in annotations, aggregations, and QuerySet.filter().
Thanks Hannes Ljungberg and Simon Charette for reviews.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-09 11:43:06 +02:00
Chris Jerdonek
f5dccbafb9
Refs #24522 -- Fixed code comment about seeds in Shuffler.__init__(). 2021-07-09 08:20:16 +02:00