summaryrefslogtreecommitdiff
path: root/django/db/models/fields
AgeCommit message (Collapse)Author
2024-07-04Fixed #35569 -- Improved wording of invalid ForeignKey error message.Jacob Walls
2024-05-22Fixed #35139 -- Prevented file read after ImageField is saved to storage.John Parton
2024-05-21Fixed #35405 -- Converted get_cache_name into a cached property in ↵Adam Johnson
FieldCacheMixin. FieldCacheMixin is used by related fields to track their cached values. This work migrates get_cache_name() to be a cached property to optimize performance by reducing unnecessary function calls when working with related fields, given that its value remains constant. Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-05-15Fixed #35384 -- Raised FieldError when saving a file without a name to ↵Jonny Park
FileField.
2024-04-01Fixed #35344, Refs #34838 -- Corrected output_field of resolved columns for ↵Johannes Westphal
GeneratedFields in aliased tables. Thanks Simon Charette for the review.
2024-03-20Fixed #35309 -- Made prefetch clear ordering for single-valued relationships.Laurent Lyaudet
2024-03-11Fixed #35285 -- Optimized ForeignObject._check_unique_target().Adam Johnson
2024-03-04Fixed #35266 -- Deferred formatting in RelatedField._check_clashes().Adam Johnson
2024-02-26Fixed #35246 -- Made Field.unique a cached property.Adam Johnson
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-02-19Refs #28011 -- Removed ForeignObjectRel.is_hidden().Adam Johnson
2024-02-19Refs #34060 -- Fixed JSONField __exact lookup for primitivies on Oracle 21c+.Albert Defler
Regression in c991602ce5798385261381025c06698d7fd30dc5. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-02-19Fixed #35230 -- Added cached ForeignObjectRel.accessor_name.Adam Johnson
2024-02-16Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on ↵ontowhee
a many to many relation. Co-Authored-By: Shiwei Chen <april.chen.0615@gmail.com>
2024-02-15Fixed #34060 -- Fixed migrations crash when adding check constraints with ↵Albert Defler
JSONField __exact lookup on Oracle.
2024-02-04Fixed #35149 -- Fixed crashes of db_default with unresolvable output field.Simon Charette
Field.db_default accepts either literal Python values or compilables (as_sql) and wrap the former ones in Value internally. While 1e38f11 added support for automatic resolving of output fields for types such as str, int, float, and other unambigous ones it's cannot do so for all types such as dict or even contrib.postgres and contrib.gis primitives. When a literal, non-compilable, value is provided it likely make the most sense to bind its output field to the field its attached to avoid forcing the user to provide an explicit `Value(output_field)`. Thanks David Sanders for the report.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2024-01-10Fixed #34769 -- Fixed key transforms on Oracle 21c+.Mariusz Felisiak
Oracle 21c introduced support for primivites in JSON fields that caused changes in handling them by JSON_QUERY/JSON_VALUE functions.
2023-12-30Fixed #29049 -- Added slicing notation to F expressions.Nick Pope
Co-authored-by: Priyansh Saxena <askpriyansh@gmail.com> Co-authored-by: Niclas Olofsson <n@niclasolofsson.se> Co-authored-by: David Smith <smithdc@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Abhinav Yadav <abhinav.sny.2002@gmail.com>
2023-12-12Fixed #35018 -- Fixed migrations crash on GeneratedField with BooleanField ↵Mariusz Felisiak
as output_field on Oracle < 23c. Thanks Václav Řehák for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-11-28Fixed #34633 -- Made create() method of reverse many-to-one managers clear ↵Aman Pandey
prefetch_related() cache.
2023-11-24Fixed #34983 -- Deprecated django.utils.itercompat.is_iterable().Nick Pope
2023-11-24Fixed #34818 -- Prevented GenericIPAddressField from mutating error messages.Parth Verma
Co-authored-by: Parth Verma <parth.verma@gmail.com>
2023-11-22Fixed #34985 -- Fixed GeneratedFields.contribute_to_class() crash when apps ↵Mariusz Felisiak
are not populated. Thanks Paolo Melchiorre for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-11-14Refs #34944 -- Propagated system checks for GeneratedField.output_field.Mariusz Felisiak
2023-11-14Fixed #34944 -- Made GeneratedField.output_field required.Mariusz Felisiak
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-10-23Fixed #34899 -- Added blank choice to forms' callable choices lazily.Nick Pope
2023-10-23Refs #34899 -- Extracted Field.flatchoices to flatten_choices helper function.Nick Pope
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>
2023-10-22Fixed #34921 -- Fixed crash of warning for unbound naive datetimes.David Sanders
2023-09-28Fixed #34877 -- Fixed migrations crash when adding GeneratedField with ↵Paolo Melchiorre
output_field with params.
2023-09-22Fixed #34861 -- Fixed crash when adding GeneratedField with some expressions.Paolo Melchiorre
Co-authored-by: Simon Charette <charette.s@gmail.com>
2023-09-19Simplified ForeignObject.resolve_related_fields() a bit.Lily Foote
2023-09-18Refs #33308 -- Removed support for passing encoded JSON string literals to ↵Mariusz Felisiak
JSONField & co. Per deprecation timeline.
2023-09-18Fixed #33651 -- Added support for prefetching GenericForeignKey.Clément Escolano
Co-authored-by: revanthgss <revanthgss@almabase.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-09-14Fixed #34838 -- Corrected output_field of resolved columns for GeneratedFields.Paolo Melchiorre
Thanks Simon Charette for the implementation idea.
2023-09-14Fixed #24561 -- Added support for callables on model fields' choices.Natalia
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-08-30 Fixed #31262 -- Added support for mappings on model fields and ↵Nick Pope
ChoiceField's choices.
2023-08-02Fixed #33507 -- Used UUID data type on MariaDB 10.7+.Albert Defler
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-06-19Refs #34517 -- Restored skipping ImageFileField.update_dimension_fields ↵François Freitag
without width/height fields. This avoids reading the image size when the dimensions fields (image_width, image_height) do not exist, as that operation may be expensive. Partially reverts ea53e7c09f1b8864c20c65976bbeaeab77abdaec, that dropped the check for the dimension fields in update_dimension_fields(), because the post_init signal was no longer registered without dimension fields. However, another code path to that function exists: when the ImageFileField is save()d, the name from the storage is setattr()ed on the field, and ImageFileDescriptor calls update_dimension_fields() because the image size might have changed. Keep bailing out early when dimensions are unused. Besides, computing the image dimensions causes to close() the file, resulting in a backward-incompatible change. The test protects against that change.
2023-05-24Fixed #34590 -- Reverted "Refs #33308 -- Improved adapting DecimalField ↵David Sanders
values to decimal." This reverts 7990d254b0af158baf827fafbd90fe8e890f23bd. Thanks Marc Odermatt for the report.
2023-05-16Fixed #34539 -- Restored get_prep_value() call when adapting JSONFields.Julie Rymer
Regression in 5c23d9f0c32f166c81ecb6f3f01d5077a6084318.
2023-05-12Fixed #470 -- Added support for database defaults on fields.Ian Foote
Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
2023-05-10Removed obsolete docstring from Field.db_returning.Lily Foote
It's also supported on SQLite 3.35+ and MariaDB 10.5+.
2023-05-03Fixed #34517 -- Avoided connection post_init signal to ImageField without ↵Orhan Hirsch
width/height fields.
2023-05-02Refs #31369 -- Improved hint message in NullBooleanField's deprecation warning.Paul Brown
2023-04-18Refs #16055 -- Deprecated ↵David Wobrock
get_joining_columns()/get_reverse_joining_columns() methods.
2023-04-18Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation ↵David Wobrock
relation on PostgreSQL.
2023-03-28Fixed #34443 -- Fixed filtering by transforms on reverse relations.Mariusz Felisiak
Regression in ce6230aa976e8d963226a3956b45a8919215dbd8.
2023-03-21Fixed #34388 -- Allowed using choice enumeration types directly on model and ↵T. Franzel
form fields.
2023-03-14Refs #28329 -- Fixed Cast() with ForeignKey to integer fields on MySQL.David Wobrock