On Fri, Jun 8, 2018 at 2:08 PM, Daniel Cardin <d.d.car...@gmail.com> wrote:
> So "ParentFeature.shows" is there for the case where I query
> `pg.query(Parent)`, I want it to be ordered ascending.
>
> The only reason i have "ParentFeature.unordered_shows" is because if I try

noting that, I don't know what unordered_shows is, your mapping has no
such attribute

> to apply an `order_by` to `Thing.name` in a query (like my query example),
> it emits "ORDER BY thing.name DESC, thing.name" (e.g. the order_by on the
> relationship is still applied, despite my sort). If I can override that, i
> have no need for both relationships

I see an order_by on ParentFeature.things, which doesn't seem to be in
your query, but if it were join eager loaded, it would be aliased, so
I don't see the problem nor have you showed anything that would do
this so I can't help without that


>
> To answer your other question. I only have the join+joinedloads from
> following
> https://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html?highlight=joinedload#the-zen-of-joined-eager-loading.

I know why one would use joinedload() in general.   The question was,
if they are removed, do you still have the problem?

>
> The query I included was only to show my attempt at writing a query which:
>
> query ParentFeature
> only get the 1 ParentFeature with a specific Parent
> apply the sort to ParentFeature.things, so the "result.one().things" is
> sorted ascending/descending

ParentFeature.things is not in the query you illustrated so I'm not following

guidance on MCVE: http://stackoverflow.com/help/mcve




>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to