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 =
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 hoping there might be some kind of .join_placeholder(UserVote)
method that I have somehow overlooked, or
Hi Michael,
Does the behavior of result.lastrowid change after SQLAlchemy version
5.5? It seems that in older versions lastrowid is the first id
inserted and in later versions lastrowid is the last id inserted.
RHH
On Fri, Apr 10, 2009 at 11:57 AM, Michael Bayermike...@zzzcomputing.com wrote:
I'm running a sqlalchemy query to get the average time per day a user
has spent on our website. The query runs properly and returns a list
of rowtuples that represent timedelta objects, so now I'm trying to
compute the average timedelta in this list. However, since each
timedelta object is of
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 =
lastrowid is not supported by DBAPI when executemany() is used, it only
applies towards a single INSERT that has inserted a single row. it
remains a straight passthrough from the DBAPI and there's no difference in
behavior on the SQLA side.
Roy Hyunjin Han wrote:
Hi Michael,
Does the
The Devil's Programmer wrote:
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
On 8 Jul 2009, at 07:29, John Hampton wrote:
John Hampton wrote:
So, the problem that I am having is that when I try to do a query,
I get
back the following error:
sqlalchemy.exc.ProgrammingError: (ProgrammingError) ('The SQL
contains 0
parameter markers, but 1 parameters were
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
The Devil's Programmer wrote:
using add_column does not seem to work the same as including both
items in the query [like below]
query = meta.Session.query(Article,
comment_count_subquery.c.article_comment_count)
it does not return an iterable result
is there any way to add subqueries to
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
13 matches
Mail list logo