ok so the problem was that I was just calling query.add_column()
without grabbing the result, ie.. query = query
*facepalm* rookie mistake
On Jul 15, 10:41 am, The Devil's Programmer
thedevilsprogram...@gmail.com wrote:
here is my code
http://pastebin.com/m13075cc9
if that helps
I am currently performing a query with a joined subquery that gets the
sum of votes on an article. The problem is that when I try to filter
based on the result of that subquery, i get errors.
Code outlining problem (very simple) - http://pastebin.com/m48905db6
Please tell me I don't have to
to start.
The Devil's Programmer wrote:
I am currently performing a query with a joined subquery that gets the
sum of votes on an article. The problem is that when I try to filter
based on the result of that subquery, i get errors.
Code outlining problem (very simple) -http
In my controller I have:
query = session.query(Article, Category, User, UserVote)
query = query.outerjoin((UserVote, and_
(Article.id==UserVote.article_id,
UserVote.voter==currently_logged_in_user)))
query = query.outerjoin((Category, Article.category_id ==
Category.id))
query =
In my controller I have:
query = session.query(Article, Category, User, UserVote)
query = query.outerjoin((UserVote, and_
(Article.id==UserVote.article_id,
UserVote.voter==currently_logged_in_user)))
query = query.outerjoin((Category, Article.category_id ==
Category.id))
query =
I can do this -
comment_count_subquery = meta.Session.query(Comment.article_id,
func.count('*').label('article_comment_count')).group_by
(Comment.article_id).subquery()
query = meta.Session.query(Article,
comment_count_subquery.c.article_comment_count)
but when I do it like this -
query =
Thanks, works like a charm :)
On Jul 15, 2:27 am, Michael Bayer mike...@zzzcomputing.com wrote:
The Devil's Programmer wrote:
So what I am trying to figure out, is if there is a way to have the
query return None in place of the missing UserVote when the user is
not logged in?
I'm
well instead of returning an iterable array of Articles, its just
returning a single Article
On Jul 15, 10:17 am, Michael Bayer mike...@zzzcomputing.com wrote:
The Devil's Programmer wrote:
using add_column does not seem to work the same as including both
items in the query [like below
here is my code
http://pastebin.com/m13075cc9
if that helps
On Jul 15, 10:22 am, The Devil's Programmer
thedevilsprogram...@gmail.com wrote:
well instead of returning an iterable array of Articles, its just
returning a single Article
On Jul 15, 10:17 am, Michael Bayer mike