change order by key to table alias as this one should be unique, name of the field dont have to be, fill release
This commit is contained in:
@ -20,6 +20,7 @@ as the same model can be registered multiple times and `ormar` needs to know fro
|
|||||||
* Fix minor bug in `order_by` for primary model order bys
|
* Fix minor bug in `order_by` for primary model order bys
|
||||||
* Fix in `prefetch_query` for multiple related_names for the same model.
|
* Fix in `prefetch_query` for multiple related_names for the same model.
|
||||||
* Fix using same `related_name` on different models leading to the same related `Model` overwriting each other, now `ModelDefinitionError` is raised and you need to change the name.
|
* Fix using same `related_name` on different models leading to the same related `Model` overwriting each other, now `ModelDefinitionError` is raised and you need to change the name.
|
||||||
|
* Fix `order_by` overwriting conditions when multiple joins to the same table applied.
|
||||||
|
|
||||||
## Docs
|
## Docs
|
||||||
* Split and cleanup in docs:
|
* Split and cleanup in docs:
|
||||||
|
|||||||
@ -400,11 +400,11 @@ class SqlJoin:
|
|||||||
)
|
)
|
||||||
if not current_table_sorted:
|
if not current_table_sorted:
|
||||||
order = text(f"{alias}_{to_table}.{pkname_alias}")
|
order = text(f"{alias}_{to_table}.{pkname_alias}")
|
||||||
self.sorted_orders[f"{part}.{pkname_alias}"] = order
|
self.sorted_orders[f"{alias}.{pkname_alias}"] = order
|
||||||
|
|
||||||
else:
|
else:
|
||||||
order = text(f"{alias}_{to_table}.{pkname_alias}")
|
order = text(f"{alias}_{to_table}.{pkname_alias}")
|
||||||
self.sorted_orders[f"{part}.{pkname_alias}"] = order
|
self.sorted_orders[f"{alias}.{pkname_alias}"] = order
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_to_and_from_keys(
|
def get_to_and_from_keys(
|
||||||
|
|||||||
Reference in New Issue
Block a user