Hello everyone,
I'm having a silly problem on eagerload, when I do:
users = session.query(User).options(eagerload('usercity')).all()
or
users = session.query(User).options(eagerload(User.usercity)).all()
Exception:
sqlalchemy.exc.ProgrammingError: (ProgrammingError) invalid reference to
2010/2/26 Marcin Krol mrk...@gmail.com:
mapper(City, city_table, properties={'users':relation(User,
order_by='user_.id', backref='city_backref')})
Isn't it
order_by='user.id'
?
--
Alex
twitter.com/alexconrad
--
You received this message because you are subscribed to the Google Groups
Alexandre Conrad wrote:
2010/2/26 Marcin Krol mrk...@gmail.com:
mapper(City, city_table, properties={'users':relation(User,
order_by='user_.id', backref='city_backref')})
Isn't it
order_by='user.id'
?
No. I explicitly named table 'user_' for it not to collide with Postgres
function
Alexandre Conrad wrote:
2010/2/26 Marcin Krol mrk...@gmail.com:
mapper(City, city_table, properties={'users':relation(User,
order_by='user_.id', backref='city_backref')})
Fixed, I should have specified order_by in a different manner:
mapper(User, user_table,
On Feb 26, 2010, at 9:05 AM, Marcin Krol wrote:
Hello everyone,
I'm having a silly problem on eagerload, when I do:
users = session.query(User).options(eagerload('usercity')).all()
or
users = session.query(User).options(eagerload(User.usercity)).all()
do not use a string for your
On Feb 26, 2010, at 10:20 AM, Marcin Krol wrote:
Alexandre Conrad wrote:
2010/2/26 Marcin Krol mrk...@gmail.com:
mapper(City, city_table, properties={'users':relation(User,
order_by='user_.id', backref='city_backref')})
Fixed, I should have specified order_by in a different manner:
I only seem to get this error when I I try to eager load a child
collection -- eager loading one child item works fine.
I've tried:
lazy=False on the relation
as well as eagerload on the query:
query.options(eagerload('foo'))
but each time I get:
(OperationalError) (1054, Unknown
diana wrote:
I only seem to get this error when I I try to eager load a child
collection -- eager loading one child item works fine.
I've tried:
lazy=False on the relation
as well as eagerload on the query:
query.options(eagerload('foo'))
but each time I get:
I've seen similar discussions here, but it's been a while so perhaps
things have changed.
class Foo(Base):
__tablename__ = 'foo'
type = Column(Integer)
__mapper_args__ = {'polymorphic_on': type}
...
class BarFoo(Foo):
__mapper_args__ = {'polymorphic_identity': 1}
bar_id =
I have a simple many to many relationship between two objects: Task and
Note, where notes are ordered by a timestamp column most recent first.
About 90% of the time what I really want to do is eagerload only the
most recent note, is there a way to do this in the mapper?
My mapper for Task
hi
lets say, A points to B.
i do a query against A about which things link to some instance of B.
then,
1) if i specify eagerload, i get many times same object-data being
piped from the server; ok but i dont want it
2) if i dont specify eagerload (lazy), access to each A fires a
hi
i want to fetch/eagerload just one column off a related object.
e.g. if
A.b pointing to B and B having x,y,z, i want to get all As and the
A.b.x, and nothing else from B.
it even doesnot actualy matter if it will be really A.b.x or just some
A.new_bx made-up column/attribute.
can?
I've got a small problem, I want to be able to join two related tables
in a query (in my case JobInfo-Chunk-Pass) so that I could use the
second table in my order_by(), I would also like them to be eagerloaded.
The problem is that in the resulting SQL the tables are joined twice,
once for the
Hi all,
I'm having an issue where I'm doing a query that I want to be loaded
all in one select to the database. I have a table ContentLeaf which
inherits from Content, I can get the ContentLeaf fields to eagerload
by using select_table in the mapper:
myjoin =
14 matches
Mail list logo