Hello group,
Suppose A has a ManyToOne relation to B (A is a child of B). I want to perform
something like :
a.b_id = b.id
assert a.b == b
How do I do this in sqlalchemy ?
The following attempt failed
---
from sqlalchemy import *
from sqlalchemy.orm import
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com]
On Behalf Of chaouche yacine
Sent: 02 September 2010 11:02
To: sqlalchemy googlegroups
Subject: [sqlalchemy] update a relation from its id
Hello group,
Suppose A has a ManyToOne relation
Hello,
Another quick question on .with_polymorhpic() .. :)
When I use inheritance I always subclass a Query object per mapped
(child) class, for example :
class QueryRoot(orm.Query):
def available_to_all_children(self):
return self.filter(...)
class RootModel(object):
query =
On Sep 2, 2010, at 8:59 AM, Julien Cigar wrote:
Hello,
Another quick question on .with_polymorhpic() .. :)
When I use inheritance I always subclass a Query object per mapped (child)
class, for example :
class QueryRoot(orm.Query):
def available_to_all_children(self):
return
On 09/02/2010 17:55, Michael Bayer wrote:
On Sep 2, 2010, at 8:59 AM, Julien Cigar wrote:
Hello,
Another quick question on .with_polymorhpic() .. :)
When I use inheritance I always subclass a Query object per mapped (child)
class, for example :
class QueryRoot(orm.Query):
def
On 26 Ago, 18:41, Michael Bayer mike...@zzzcomputing.com wrote:
of course you'll get a cycle if you do this, though:
s1 = School(cod=S1, cod_riferimento=S1, cliente=False)
d1 = School(cod=D1, cod_riferimento=S1, cliente=False)
s1.sedi = [s1, d1]
That was it! now I got it. thanks.
s1-s1
meta.Session.query(Job).order_by(Job.min_level).order_by(Job.descr).filter(Job.tier==1).outerjoin((User_job_progress,
User_job_progress.job_id==Job.job_id)).filter(User_job_progress.fb_uid==1)
results in a query of:
FROM xxx_jobs LEFT OUTER JOIN xxx_user_job_progress ON
On Sep 2, 2010, at 6:51 PM, cd34 wrote:
meta.Session.query(Job).order_by(Job.min_level).order_by(Job.descr).filter(Job.tier==1).outerjoin((User_job_progress,
User_job_progress.job_id==Job.job_id)).filter(User_job_progress.fb_uid==1)
results in a query of:
FROM xxx_jobs LEFT OUTER JOIN
Just not having a lot of luck here. :)
meta.Session.query(Job).order_by(Job.min_level).order_by(Job.descr).filter(Job.tier==1).outerjoin((User_job_progress,
and_(User_job_progress.job_id==Job.job_id,
User_job_progress.fb_uid==1))).all()
results in:
SELECT xxx_jobs.job_id AS xxx_jobs_job_id,
thanks for the advice.
for the curious: the problem is in reading few rows pgARRAY.
Table company
Column |Type | Modifiers
phone | character varying(150)[]| not null
...
from pg8000 import DBAPI
conn = DBAPI.connect(host=localhost, user=x,
% for job,progress in tmpl_context.jobs:
error on my part after the outerjoin.
Thanks for the pointers in the right direction.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To
11 matches
Mail list logo