Re: [sqlalchemy] need help with query

2016-03-01 Thread sector119
With that query I get: InvalidRequestError: Could not find a FROM clause to join from. Tried joining to , but got: Can't find any foreign key relationships between 'category' and 'product'. Product and category model has many to many relationship -- You received this message because you are

Re: [sqlalchemy] need help with query

2016-03-01 Thread Simon King
http://docs.sqlalchemy.org/en/rel_1_0/orm/tutorial.html#querying-with-joins You want something like: DBSession.query(Category).join(‘products’, ‘brand’).filter(Brand.slug==brand_slug) Hope that helps, Simon > On 1 Mar 2016, at 20:11, sector119 wrote: > > It works, but

Re: [sqlalchemy] Date range query problem

2016-03-01 Thread Nana Okyere
Ok. How do you guys suggest I make the query to capture results for the end point date? -- 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

Re: [sqlalchemy] Date range query problem

2016-03-01 Thread Simon King
On Tue, Mar 1, 2016 at 4:17 PM, Nana Okyere wrote: > Mike, thanks for your response. I turned on the echo to see the values. > Looks like it is passing a datetime.date objects. So I don't see a time > part of the date. Here's the relevant part of the echo output. > > I selected

Re: [sqlalchemy] Date range query problem

2016-03-01 Thread Nana Okyere
Mike, thanks for your response. I turned on the echo to see the values. Looks like it is passing a datetime.date objects. So I don't see a time part of the date. Here's the relevant part of the echo output. I selected between two days ago and yesterday. It includes results for two days ago but

[sqlalchemy] Session flush trigger misunderstanding or unexpected behaviour

2016-03-01 Thread Bastien Sevajol
Hi, I'm confronted to an misunderstanding or unexpected behavior of session trigger flush. I want to manage revision of a document, like in this doc example. But the behavior is unexpected: I want to