change limit/offset with select related to be applied on a subquery and limit only main model query

This commit is contained in:
collerek
2020-12-21 18:42:17 +01:00
parent 514e8c4ad5
commit c8aad2385c
18 changed files with 329 additions and 69 deletions

View File

@ -48,8 +48,8 @@ def register_many_to_many_relation_on_build(
:param field: relation field
:type field: ManyToManyField class
"""
alias_manager.add_relation_type(field.through, new_model.get_name(), is_multi=True)
alias_manager.add_relation_type(field.through, field.to.get_name(), is_multi=True)
alias_manager.add_relation_type(field.through, new_model.get_name())
alias_manager.add_relation_type(field.through, field.to.get_name())
def expand_reverse_relationships(model: Type["Model"]) -> None: