Re: [sqlalchemy] one-to-one: lost on track

2015-10-01 Thread Richard Gerd Kuesters
ok, just for the record, my "lazyness" lead me to use `lazy='joined'` in 
a backref and now things works fine :)


richard.


On 10/01/2015 09:03 AM, Richard Gerd Kuesters wrote:

hey all!

i think i got lost on track about relationships, specially one-to-one. 
i'll not go into (code) details because all my one-to-one are failing 
with the following exception:

*
*

*python2.7/site-packages/sqlalchemy/orm/query.pyc in
_no_criterion_assertion(self, meth, order_by, distinct)*
*361 raise sa_exc.InvalidRequestError(*
*362 "Query.%s() being called on a "*
*--> 363 "Query with existing criterion. " % meth)*
*364 *
*365 def _no_criterion_condition(self, meth,
order_by=True, distinct=True):*

*InvalidRequestError: Query.get() being called on a Query with
existing criterion.*


*i think* this happens because i have a custom session that applies a 
filter to all objects queried, even `session.query(A).first()`. 
perhaps someone got stuck on the same problem? faq? anything? :)


best regards and sorry for my possible irresponsible lazyness,

richard.
--
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 http://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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
<>

[sqlalchemy] one-to-one: lost on track

2015-10-01 Thread Richard Gerd Kuesters

hey all!

i think i got lost on track about relationships, specially one-to-one. 
i'll not go into (code) details because all my one-to-one are failing 
with the following exception:

*
*

   *python2.7/site-packages/sqlalchemy/orm/query.pyc in
   _no_criterion_assertion(self, meth, order_by, distinct)*
   *361 raise sa_exc.InvalidRequestError(*
   *362 "Query.%s() being called on a "*
   *--> 363 "Query with existing criterion. " % meth)*
   *364 *
   *365 def _no_criterion_condition(self, meth, order_by=True,
   distinct=True):*

   *InvalidRequestError: Query.get() being called on a Query with
   existing criterion.*


*i think* this happens because i have a custom session that applies a 
filter to all objects queried, even `session.query(A).first()`. perhaps 
someone got stuck on the same problem? faq? anything? :)


best regards and sorry for my possible irresponsible lazyness,

richard.

--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
<>