summaryrefslogtreecommitdiff
path: root/tests/defer_regress/models.py
AgeCommit message (Collapse)Author
2024-04-23Fixed #35356 -- Deferred self-referential foreign key fields adequately.Simon Charette
While refs #34612 surfaced issues with reverse one-to-one fields deferrals, it missed that switching to storing remote fields would break self-referential relationships. This change switches to storing related objects in the select mask instead of remote fields to prevent collisions when dealing with self-referential relationships that might have a different directional mask. Despite fixing #21204 introduced a crash under some self-referential deferral conditions, it was simply not working even before that as it aggregated the sets of deferred fields by model. Thanks Joshua van Besouw for the report and Mariusz Felisiak for the review.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-04-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2017-05-10Decreased max_length for char fields unless absolutely needed. (#8485)Florian Apolloner
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2014-06-25Fixed #22050 -- Fixed defer fields on proxy related models.Lovas Bence
2014-01-05Removed useless model definitions.Aymeric Augustin
Surprisingly, this commit doesn't change any behavior at all. When a model is defined with the same name as another model in the same app, the definition of the first class is bound to the name of the class regardless of the definition of the second class.
2013-11-02PEP8Jason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-05-31Fixed #16436 -- Oracle defer_regress test failureAnssi Kääriäinen
Oracle doesn't like grouping by TextField, so use CharFields instead in models.
2013-05-30Fixed #16436 -- defer + annotate + select_related crashTai Lee
Correctly calculate the ``aggregate_start`` offset from loaded fields, if any are deferred, instead of ``self.query.select`` which includes all fields on the model. Also made some PEP 8 fixes.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner