Skip to content

Conversation

@craigds
Copy link
Owner

@craigds craigds commented Aug 16, 2021

todo:

  • fix test_generic_relation under django 3.2 (?)

If you use QuerySet.defer() or QuerySet.only() to defer fields,
and one of the fields you defer is the `type` field, this change
means that typedmodels will no longer automatically cast the
model instances in the queryset to the correct type.

Previously, we did automatically cast the instances, at the expense
of doing an extra query *per instance* (that's just how field deferral
works.)

With Django 3.2 (due to some complicated internal changes in the ORM)
that no longer works.
@craigds craigds marked this pull request as ready for review August 19, 2021 21:34
@craigds craigds force-pushed the modern-django branch 6 times, most recently from d1b14d5 to a4d8c5f Compare August 19, 2021 21:46
@craigds craigds merged commit cfae4d9 into master Aug 19, 2021
@craigds craigds deleted the modern-django branch August 19, 2021 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants