Hi!
I have this query:
q1 = (s.query()
.add_columns(
Movement.customer_id,
Movement.document_id,
func.sum(Movement.debt).label('debt_moved'),
Hello.
Perhaps something like this is what you are looking for?
def q_union():
s = session
q1 = s.query(
Movement.customer_id.label('customer_id'),
Movement.document_id.label('document_id'),
Movement.debt.label('debt_moved'),
As usual, I forgot to add the attachment...
Ladislav Lenart
On 21.3.2013 13:57, Ladislav Lenart wrote:
Hello.
Perhaps something like this is what you are looking for?
def q_union():
s = session
q1 = s.query(
Movement.customer_id.label('customer_id'),
Given the following statement:
p = db.query(Profile).options(joinedload('*')).filter_by(id=p.id).limit(1).one()
I will get a subquery + a join, instead of a pure join:
SELECT [...] FROM (SELECT profile.id AS profile_id, ...FROM profile WHERE
profile.id = %(id_1)s
LIMIT %(param_1)s) AS
On 21 Mar 2013, at 20:56, Jose Neto jbastosn...@gmail.com wrote:
Given the following statement:
p =
db.query(Profile).options(joinedload('*')).filter_by(id=p.id).limit(1).one()
I will get a subquery + a join, instead of a pure join:
SELECT [...]
FROM (SELECT profile.id AS