On 09/09/2016 05:13 PM, Iain Duncan wrote:
Hi all, I have a query that gets conditionally extending depending on
what's going with a given request. I've got a section where it should
join something and search on that join, but if the same join has already
happened, I get an error. I've figured out i can do the following, which
looks like I'm stepping out of the public api:

if UserOrgRoleAssoc  not in [ent.class_ for ent in query._join_entities]:
  query.join(UserOrgRoleAssoc)

Is there a better (proper?) way to do this?

A real API for this kind of thing is proposed long term:

https://bitbucket.org/zzzeek/sqlalchemy/issues/3225/query-heuristic-inspection-system

for now, not really, either look at the private attributes or track these things on the outside (safer).




thanks!
Iain

--
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
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
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