On Sunday, April 19, 2015 at 7:08:41 PM UTC-4, Michael Bayer wrote:
If I want *all* of the Thing object, I change it to this:
q = s.query(Thing, func.count(Comment.type)).\
filter(Thing.creation = datetime.date(2015, 4, 19)).\
filter(Thing.creation datetime.date(2015, 4, 26)).\
Sorry, sometimes you get so deep into something you forget everyone else
isn't familiar with the problem.
As an example, here's what I'm looking for:
select things.id, count(comments.type) from things things, comments comments
where things.creation = 2015-04-19 and things.creation
On 4/19/15 9:36 AM, ThereMichael wrote:
Sorry, sometimes you get so deep into something you forget
everyone else isn't familiar with the problem.
As an example, here's what I'm looking for:
select things.id, count(comments.type) from things things, comments
comments
where
On 4/19/15 10:16 AM, ThereMichael wrote:
Ok, that worked perfectly!
If I want /all/ of the Thing object, I change it to this:
q = s.query(Thing, func.count(Comment.type)).\
filter(Thing.creation = datetime.date(2015, 4, 19)).\
filter(Thing.creation datetime.date(2015, 4, 26)).\
On 4/19/15 9:56 AM, Mike Bayer wrote:
On 4/19/15 9:36 AM, ThereMichael wrote:
Sorry, sometimes you get so deep into something you forget
everyone else isn't familiar with the problem.
As an example, here's what I'm looking for:
select things.id, count(comments.type) from things
Ok, that worked perfectly!
If I want *all* of the Thing object, I change it to this:
q = s.query(Thing, func.count(Comment.type)).\
filter(Thing.creation = datetime.date(2015, 4, 19)).\
filter(Thing.creation datetime.date(2015, 4, 26)).\
filter(Comment.target_id == Thing.id).\
On 4/18/15 7:13 PM, Michael Wilson wrote:
I have the following tables:
things_table = Table(’thing', self.metadata,
Column('id', Integer, primary_key=True),
…
)
comments_table = Table('comments', self.metadata,
Column('id', Integer, primary_key=True), # Unique id for this
I have the following tables:
things_table = Table(’thing', self.metadata,
Column('id', Integer, primary_key=True),
…
)
comments_table = Table('comments', self.metadata,
Column('id', Integer, primary_key=True), # Unique id for this
comment
Column('type',