summaryrefslogtreecommitdiff
path: root/django
AgeCommit message (Collapse)Author
2023-09-13Fixed #34822 -- Added support for serializing functions decorated with ↵Nick Pope
functools.lru_cache in migrations. `@functools.cache` and `@functools.lru_cache` return an object of type `functools._lru_cache_wrapper` which prevented the migrations serializer from working. Simply using the existing `FunctionTypeSerializer` for this additional type works as expected.
2023-09-13Refs #31949 -- Made make_middleware_decorator to work with async functions.Ben Lomax
2023-09-13Modernized enumeration helpers on Python 3.11+.Nick Pope
- use @enum.property https://docs.python.org/3/library/enum.html#enum.property - use @enum.nonmember Using @property on an enum class does not yield the expected result. do_not_call_in_templates attribute works because a @property instance is truthy. We can make this a literal True value as expected by using @enum.nonmember in Python 3.11+. https://docs.python.org/3/library/enum.html#enum.nonmember - used enum.IntEnum/StrEnum Python 3.11+ has ReprEnum which uses int.__str__() and str.__str__() for __str__() in the `IntEnum` and `StrEnum` subclasses. We can emulate that for Python < 3.11. https://docs.python.org/3/library/enum.html#enum.ReprEnum https://docs.python.org/3/library/enum.html#enum.IntEnum https://docs.python.org/3/library/enum.html#enum.StrEnum
2023-09-13Refs #34233 -- Used @staticmethod with TextChoices._generate_next_value_().Nick Pope
Now that Python 3.10 is the minimum supported version, we can decorate _generate_next_value_() with @staticmethod. It wasn't possible before as Python < 3.10 does not support calling static methods direct from the class body. https://docs.python.org/3/library/enum.html#enum.Enum._generate_next_value_
2023-09-12Renamed ChoicesMeta to ChoicesType.Nick Pope
This also uses enum.EnumType for Python 3.11+ as Python 3.11 renamed EnumMeta to EnumType. While the former is still available as an alias of the latter for now, let's prefer the canonical name for this. Check out https://docs.python.org/3/library/enum.html#enum.EnumType
2023-09-12Removed ChoicesMeta.__contains__() for Python 3.12+.Nick Pope
In Python 3.12 it is possible to check containment using member values, not just the members themselves. https://docs.python.org/3/library/enum.html#enum.EnumType.__contains__
2023-09-11Fixed #34752 -- Fixed handling ASGI http.disconnect for streaming responses.Sam Toyer
2023-09-11Fixed #34821 -- Prevented DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings ↵Mariusz Felisiak
from mutating the main STORAGES. Regression in 6b965c600054f970bdf94017ecf2e0e6e0a4326b.
2023-09-11Fixed #34824 -- Prevented unnecessary AlterField when ↵donghao
ForeignObject.from_fields/to_fields is not a tuple.
2023-09-11Fixed #34642 -- Added File.open() support for *args and **kwargs.Yves Weissig
2023-09-09Fixed #34820 -- Fixed migrations crash when changing a ForeignObject field.donghao
2023-09-08Fixed #34816 -- Fixed GenericForeignKey crash when checking cache for ↵Oguzhan Akan
primary keys with different types.
2023-09-07Fixed #34791 -- Fixed incorrect Prefetch()'s cache for singly related objects.Maxime Toussaint
Changed the cache name used for singly related objects to be the to_attr parameter passed to a Prefetch object. This fixes issues with checking if values have already been fetched in cases where the Field already has some prefetched value, but not for the same model attr.
2023-09-07Fixed #31300 -- Added GeneratedField model field.Jeremy Nauta
Thanks Adam Johnson and Paolo Melchiorre for reviews. Co-Authored-By: Lily Foote <code@lilyf.org> Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-09-05Fixed #34730 -- Added ↵François Freitag
django.contrib.messages.test.MessagesTestMixin.assertMessages().
2023-09-04Refs #31262 -- Renamed ChoiceIterator to BaseChoiceIterator.Nick Pope
Some third-party applications, e.g. `django-filter`, already define their own `ChoiceIterator`, so renaming this `BaseChoiceIterator` will be a better fit and avoid any potential confusion. See https://github.com/carltongibson/django-filter/pull/1607.
2023-09-04Fixed CVE-2023-41164 -- Fixed potential DoS in ↵Mariusz Felisiak
django.utils.encoding.uri_to_iri(). Thanks MProgrammer (https://hackerone.com/mprogrammer) for the report. Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
2023-09-03Refs #34768 -- Ignored lack of just_fix_windows_console() for colorama < 0.4.6.Mariusz Felisiak
2023-09-01Fixed #34778 -- Avoided importing modules in startapp/startproject.Jacob Walls
2023-09-01Fixed #34768 -- Avoided initializing colorama on non-Windows platforms.Sulabh Katila
2023-09-01Fixed #34803 -- Fixed queryset crash when filtering againts deeply nested ↵willzhao
OuterRef annotations. Thanks Pierre-Nicolas Rigal for the report. Regression in c67ea79aa981ae82595d89f8018a41fcd842e7c9.
2023-09-01Fixed #34807 -- Avoided circular import between forms, models, and utils' ↵nessita
choices. Thanks Collin Anderson for the report. Regression in 500e01073adda32d5149624ee9a5cb7aa3d3583f.
2023-08-31Refs #34712 -- Added system check for staticfiles storage in STORAGES setting.Bruno Alla
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>
2023-08-31Fixed #34210 -- Added unittest's durations option to the test runner.David Smith
2023-08-31Fixed #34547 -- Deprecated DatabaseOperations.field_cast_sql().David Smith
2023-08-30 Fixed #31262 -- Added support for mappings on model fields and ↵Nick Pope
ChoiceField's choices.
2023-08-30Fixed #34799 -- Made MySQL introspection skip cross-database relations.John Whitman
2023-08-30Fixed #34757 -- Added support for following redirects to AsyncClient.Olivier Tabone
2023-08-28Refs #34784 -- Added fr_CA locale formats.Simon Charette
Formating rules sourced from - https://www.btb.termiumplus.gc.ca/tpv2guides/guides/clefsfp/index-fra.html?lang=fra&lettr=indx_catlog_d&page=9lcOojjUrxt8.html - https://vitrinelinguistique.oqlf.gouv.qc.ca/21241/la-typographie/nombres/ecriture-des-dates-et-des-heures-dans-certains-contextes-techniques - https://en.wikipedia.org/wiki/Date_and_time_notation_in_Canada - https://metacpan.org/dist/DateTime-Locale/view/lib/DateTime/Locale/fr_CA.pod
2023-08-28Fixed #34784 -- Adjusted SHORT_DATE_FORMAT in various French variants.Claude Paroz
2023-08-28Fixed #34787 -- Fixed autoreloader crash when run from installed script on ↵sarahboyce
Windows.
2023-08-25Fixed #34709 -- Raised BadRequest for non-UTF-8 requests with the ↵Mariusz Felisiak
application/x-www-form-urlencoded content type. Thanks Eki Xu for the report.
2023-08-25Refs #34730 -- Made Message importable from django.contrib.messages.François Freitag
2023-08-25Simplified QuerySet.update_or_create() a bit.Muzaffer Cikay
2023-08-24Refs #24121 -- Added __repr__() to Message.François Freitag
2023-08-24Corrected AsyncRequestFactory's docstring.Mariusz Felisiak
All AsyncRequestFactory methods are still synchronous callables.
2023-08-23Fixed #34744 -- Prevented recreation of migration for constraints with a ↵David Sanders
dict_keys. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-08-23Refs #34757 -- Moved HTTP redirect logic to django.test.client.ClientMixin.Olivier Tabone
2023-08-22Fixed #34788 -- Corrected NUMBER_GROUPING for Japanese.tell-k
2023-08-21Fixed #33143 -- Raised RuntimeWarning when performing import-time queries.Florian Zimmermann
2023-08-20Fixed DatabaseCreation.get_test_db_clone_settings() for empty database name ↵Mariusz Felisiak
on SQLite. Empty string should be considered an in-memory SQLite database.
2023-08-19Fixed #34779 -- Avoided unnecessary selection of non-nullable m2m fields ↵Juan Alvarez
without natural keys during serialization. By using `select_related(None)` instead of `select_related()`, the unnecessary joins are completely avoided. Note that the current tests already covers the change, when the field is not `null=True`. Regression in f9936deed1ff13b20e18bd9ca2b0750b52706b6c.
2023-08-18Fixed #34773 -- Fixed syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE ↵Mariusz Felisiak
settings with STORAGES. Thanks Petr Dlouhý for the report. Bug in 32940d390a00a30a6409282d314d617667892841.
2023-08-12Added Uyghur language.Azat
2023-08-11Fixed #34362 -- Fixed FilteredRelation() crash on conditional expressions.Francesco Panico
Thanks zhu for the report and Simon Charette for reviews.
2023-08-11Fixed #34743 -- Fixed Meta.constraints validation crash when using pk.Francesco Panico
Thanks Nwawel A Iroume for the report.
2023-08-10Fixed #33817 -- Added support for python-oracledb and deprecated cx_Oracle.Jingbei Li
2023-08-10Fixed DatabaseFeatures.supports_primitives_in_json_field on Oracle 21c+.Mariusz Felisiak
2023-08-09Refs #34233 -- Bumped required cx_Oracle to 8.3.Mariusz Felisiak
This bumps minimum supported versions of cx_Oracle to the first release to support Python 3.10.
2023-08-09Fixed #34692 -- Made autoreloader reset cached template loader for default ↵priyank.panchal
renderer.