Handle path_infos / reverse_path_infos cached properties (Dj4.1 compatibility) #792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In django/django@a697424 / django/django#14750, Django has introduced two new cached properties
path_infos
andreverse_path_infos
to be used in preference to theget_path_info()
andget_reverse_path_info()
methods when not passing afiltered_relation
argument.TaggableManager is patching these methods, so to avoid Django bypassing them (specifically in
django.db.query.Query.names_to_path
) it needs to provide these cached properties too.For additional bonus points, we also update TaggableManager's
_get_mm_case_path_info
and_get_gfk_case_path_info
methods to make use of the new cached properties where available.This (along with #791, incorporated here) gets the test suite passing again on the current Django main branch.