summaryrefslogtreecommitdiff
path: root/tests/model_fields/models.py
AgeCommit message (Collapse)Author
2024-07-15[5.1.x] Refs #35560 -- Corrected required feature flags in ↵Mariusz Felisiak
GeneratedModelUniqueConstraint. Backport of 2d3bb414cfb2778cc64f22e7203102d7389f81e6 from main.
2024-07-04[5.1.x] Fixed #35560 -- Made Model.full_clean() ignore GeneratedFields for ↵Mark Gensler
constraints. Accessing generated field values on unsaved models caused a crash when validating CheckConstraints and UniqueConstraints with expressions. Backport of 1005c2abd1ef0c156f449641e38c33e473989d37 from main.
2024-05-22[5.1.x] Fixed #35472 -- Used temporary directory in test_imagefield.NoReadTests.Sarah Boyce
Backport of 7e39ae5c8cf4c6601a4f47b72914349481c5331b from main.
2024-05-22Fixed #35139 -- Prevented file read after ImageField is saved to storage.John Parton
2024-01-19Fixed #35127 -- Made Model.full_clean() ignore GeneratedFields.Mariusz Felisiak
Thanks Claude Paroz for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-12-08Fixed #35019 -- Fixed save() on models with both GeneratedFields and ↵Sarah Boyce
ForeignKeys. Thanks Deb Kumar Das for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-12-07Fixed #35024 -- Fixed model instance creation crash on ↵Mariusz Felisiak
GeneratedField.output_field with backend converters. Regression in d9de74141e8a920940f1b91ed0a3ccb835b55729. This is a long standing issue, however it caused a crash of GeneratedFields for all output fields that have backend-specific converters when the RETURNING clause is not supported (MySQL and SQLite < 3.35). That's why severity was exacerbated.
2023-11-14Fixed #34944 -- Made GeneratedField.output_field required.Mariusz Felisiak
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-11-02Refs #31300 -- Allowed testing GeneratedField without collation.Tim Graham
CockroachDB and Snowflake don't support it.
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-22Added tests for model field's choices iterator/iterable values.Natalia
2023-03-21Fixed #34388 -- Allowed using choice enumeration types directly on model and ↵T. Franzel
form fields.
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2022-08-23Removed unused path variable in model_fields tests.Claude Paroz
2022-06-03Removed obsolete assertions in BooleanFieldTests.test_return_type().Mariusz Felisiak
Added in e9bbdb39de3047761fa8d03d5241eccd571093ff. Obsolete since e9103402c0fa873aea58a6a11dba510cd308cb84.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-01-14Refs #31369 -- Removed models.NullBooleanField per deprecation timeline.Mariusz Felisiak
2020-11-27Fixed #25534, Fixed #31639 -- Added support for transform references in ↵Ian Foote
expressions. Thanks Mariusz Felisiak and Simon Charette for reviews.
2020-05-08Fixed #12990, Refs #27694 -- Added JSONField model field.sage
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-11-19Fixed #30987 -- Added models.PositiveBigIntegerField.Caio Ariede
2019-08-05Fixed #28393 -- Added helpful error messages for invalid ↵Diederik van der Boor
AutoField/FloatField/IntegerField values. Co-authored-by: Diederik van der Boor <vdboor@edoburu.nl> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2019-03-23Removed redundant model field choices tests.Matthias Kestenholz
2019-03-17Refs #12663 -- Fixed reference to nonexistent field in model_fields tests.Simon Charette
2019-01-30Fixed #30076 -- Added Model.get_FOO_display() even if field's choices are empty.Joshua Cannon
2018-03-20Fixed #29227 -- Allowed BooleanField to be null=True.Tim Graham
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
2017-11-13Simplified choices iterators in tests.model_fields.models.Sergey Fedoseev
2017-08-31Fixed #28543 -- Prevented ManyToManyField.value_from_object() from being lazy.Tim Graham
Previously, it was a QuerySet which could reevaluate to a new value if the model's data changes. This is inconsistent with other Field.value_from_object() methods. This allows reverting the fix in the admin for refs #27998.
2017-05-10Decreased max_length for char fields unless absolutely needed. (#8485)Florian Apolloner
2017-03-04Refs #27795 -- Removed unneeded force_text callsClaude Paroz
Thanks Tim Graham for the review.
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-17Refs #26154 -- Removed deprecated CommaSeparatedIntegerField.Tim Graham
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-10-28Fixed #27188 -- Allowed using unique=True with FileField.Michael Scott
Thanks Tim Graham for the initial patch.
2016-03-23Split model_fields tests into different files.Tim Graham
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-07-21Fixed #25129 -- Made model instance defaults work with migrations (refs #24919).Tim Graham
2015-07-17Fixed #16501 -- Added an allow_unicode parameter to SlugField.Edward Henderson
Thanks Flavio Curella and Berker Peksag for the initial patch.
2015-05-12[1.8.x] Refs #24698, #24712 -- Forwardported ForeignKey.get_db_prep_value() ↵Abhaya Agarwal
test and release notes. Fixed in master by b68212f539f206679580afbfd008e7d329c9cd31. Forwardport of 290c9d665490d80b0a1b648fb022190d7dc375fc from stable/1.8.x
2015-03-25Fixed #24215 -- Refactored lazy model operationsAlex Hill
This adds a new method, Apps.lazy_model_operation(), and a helper function, lazy_related_operation(), which together supersede add_lazy_relation() and make lazy model operations the responsibility of the App registry. This system no longer uses the class_prepared signal.
2015-02-23Guaranteed removal of temporary files during tests.Aymeric Augustin
Dropped the DJANGO_TEST_TEMP_DIR environment variable. Before this change, proper removal depended on the developer passing dir=os.environ['DJANGO_TEST_TMP_DIR'] to tempfile functions.
2015-02-21Fixed #24376 -- added verbose_name arg to UUIDFieldMichael Angeletti
2015-02-20Fixed #24343 -- Ensure db converters are used for foreign keys.Marc Tamlyn
Joint effort between myself, Josh, Anssi and Shai.
2015-02-12Refs #24215 -- Prevented pending lookup pollution by abstract models.Simon Charette
2015-02-06Fixed E265 comment styleCollin Anderson
2015-02-06Sorted imports with isort; refs #23860.Tim Graham