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
On
using 5.5
from sqlalchemy import create_engine, Table, Column,
ForeignKeyConstraint, MetaData, and_, String, Integer, ForeignKey
from sqlalchemy.orm import relation, sessionmaker, synonym, join
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('sqlite:///:memory:')
On Mon, 13 Jul 2009 19:18:39 -0400
Michael Bayer mike...@zzzcomputing.com wrote:
Brad Wells wrote:
Is it possible to perform a query.count() on a query with a labeled
column expression without count() adding the subselect? I need to
filter on the value of the expression and get a count
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
Kyle Schaffrick wrote:
On Mon, 13 Jul 2009 19:18:39 -0400
Michael Bayer mike...@zzzcomputing.com wrote:
Brad Wells wrote:
Is it possible to perform a query.count() on a query with a labeled
column expression without count() adding the subselect? I need to
filter on the value of the
what is the SQL you would like emitted ? that is always the place 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
GHZ wrote:
boston_addresses = relation('Address',
primaryjoin = and_
('User.user_id==Address.user_id',
'Address.city==Boston'),
foreign_keys = ['Address.user_id'])
the expression sent to primaryjoin must be an expression
I was getting ready to do something similar, and now I am confused.
How is what GHZ is doing fundamentally different from the documentation
example Specifying Alternate Join Conditions to relation()? Doesn't that
example wrap the primaryjoin in the and_() construct also?
Mike Conley wrote:
I was getting ready to do something similar, and now I am confused.
How is what GHZ is doing fundamentally different from the documentation
example Specifying Alternate Join Conditions to relation()? Doesn't that
example wrap the primaryjoin in the and_() construct also?
Ahh!! Starting to understand it. In this case, the entire expression to
primaryjoin must be a string. The explanation about eval'ing the string when
mappers are compiled makes sense.
Now I see the relation in GHZ's example and in the code I will be writing
should look something like this.
I'm trying to create a custom geometry type for MySQL, but I'm running
up against my limited knowledge of SQLAlchemy.
My goal is to be able to pass in a geos.Point object on INSERT and
UPDATE, convert it to WKT representation ('POINT (1.
2.)'), and pass that to
J. Cliff Dyer wrote:
I'm trying to create a custom geometry type for MySQL, but I'm running
up against my limited knowledge of SQLAlchemy.
My goal is to be able to pass in a geos.Point object on INSERT and
UPDATE, convert it to WKT representation ('POINT (1.
On Wed, 15 Jul 2009 10:35:24 -0400
Michael Bayer mike...@zzzcomputing.com wrote:
Kyle Schaffrick wrote:
On Mon, 13 Jul 2009 19:18:39 -0400
Michael Bayer mike...@zzzcomputing.com wrote:
Brad Wells wrote:
Is it possible to perform a query.count() on a query with a
labeled
Ok so I understand now that this is a limitation in SQL, and that I
cannot use the result of a subquery in the from clause within my where
cause.
I believe I am supposed to wrap the whole query inside another query
and put the where clause on the outer query, would this be correct? I
have tried
On Jul 15, 2009, at 5:03 PM, Kyle Schaffrick wrote:
len(query) forces us to play games with the __iter__ method on query
such that it can't be a real iterator.
Hmm, I thought there was a __len__ magic method, such that
len(something) is the same as something.__len__(), when the latter is
15 matches
Mail list logo