[sqlalchemy] Re: adjacency via table

2011-02-20 Thread farcat
Thank you, Basically the multiple inheritance structure is a directional non- cyclic graph (i looked at the graph example code in the distribution, it uses methods to get next/previous nodes) . Members are basically another name for attributes. I understand the need for the primaryjoin now.

[sqlalchemy] difference between query.count() and query.all(), concurrency?

2011-02-20 Thread fred . haze
Hi listmembers, i have a problem with a difference i find playing with sqla between query.count and query.all results. I have a parent class declaratively mapped to a table in MySQL, there is a child class with a relationship. I'm not sure how to create a quick session (i suspect a problem

[sqlalchemy] Re: adjacency via table

2011-02-20 Thread farcat
Thank you, Basically the multiple inheritance structure is a directional non- cyclic graph (i looked at the graph example code in the distribution, it uses methods to get next/previous nodes, which could serve as a workaround, but seems inelegant) . Members are basically another name for

[sqlalchemy] Re: Optimize a search in several classes (each of them with simple 1:N relationships)

2011-02-20 Thread Hector Blanco
Amazing: session.query(Cashier.Cashier).join(Register.Register).join(Store.Store).all() I hadn't tried before because I thought it would be too straight forward... 2011/2/16 Hector Blanco white.li...@gmail.com: Hello everyone! I have a class structure like this: class

[sqlalchemy] Re: Filtering by a foreign key (now, without typo).

2011-02-20 Thread Hector Blanco
It was working from gecko... I hadn't considered my dumbness.. I went trough all the records in my database and it turns out I was having way more WhateverClass in the ContainerClass with id == 5 than I thought!!! It was working from the beginning! 2011/2/12 Hector Blanco white.li...@gmail.com:

Re: [sqlalchemy] difference between query.count() and query.all(), concurrency?

2011-02-20 Thread Michael Bayer
On Feb 20, 2011, at 8:40 AM, fred.h...@mail.com wrote: Hi listmembers, i have a problem with a difference i find playing with sqla between query.count and query.all results. I have a parent class declaratively mapped to a table in MySQL, there is a child class with a relationship. I'm

Re: [sqlalchemy] Re: adjacency via table

2011-02-20 Thread Michael Bayer
On Feb 20, 2011, at 10:30 AM, farcat wrote: Thank you, Basically the multiple inheritance structure is a directional non- cyclic graph (i looked at the graph example code in the distribution, it uses methods to get next/previous nodes, which could serve as a workaround, but seems inelegant)

Re: [sqlalchemy] difference between query.count() and query.all(), concurrency?

2011-02-20 Thread fred . haze
Hello Michael, thank you (all) for sqlalchemy :) The uniquifying had me spooked, and i am afraid it got me confused completely about connections, sessions, autoflushing and all the wonderful toys. Still don't know what a good pattern would be. I now even flush() and commit() directly after

[sqlalchemy] Conflicted about autocommit

2011-02-20 Thread darkporter
I'm not sure what the right setting for autocommit is. I'd prefer to leave it off, because database updates make more sense to me with session.commit() calls. Modify anything locally you want to change, then call commit(): some_model.name = John some_model.zip = 11201 session.commit()

Re: [sqlalchemy] difference between query.count() and query.all(), concurrency?

2011-02-20 Thread fred . haze
hi Michael, strangely enough when querying like you hinted i only get one row uniqueified again. So i must be missing still more of how this should work. My database nicely shows two rows queried with sql (Products and Products_descripition joined, filtered by a products_id), with python

Re: [sqlalchemy] Conflicted about autocommit

2011-02-20 Thread Michael Bayer
On Feb 20, 2011, at 3:31 PM, darkporter wrote: I'm not sure what the right setting for autocommit is. I'd prefer to leave it off, because database updates make more sense to me with session.commit() calls. Modify anything locally you want to change, then call commit(): some_model.name

Re: [sqlalchemy] difference between query.count() and query.all(), concurrency?

2011-02-20 Thread Michael Bayer
On Feb 20, 2011, at 3:17 PM, fred.h...@mail.com wrote: Hello Michael, thank you (all) for sqlalchemy :) The uniquifying had me spooked, and i am afraid it got me confused completely about connections, sessions, autoflushing and all the wonderful toys. I'm not really sure how

[sqlalchemy] Re: adjacency via table

2011-02-20 Thread farcat
Thank you, the many to many (following the pattern in the link above) seems to work, now on to the association table (later ... ) Cheers BTW: in A - (one to many) B - C, does (seen from A) primaryjoin refer to the relation between A and B and secondaryjoin to the relation between B and C?

[sqlalchemy] condition on every query

2011-02-20 Thread robert
I'm looking for a way to add a condition to every query, including child queries. I've tried both the Pre-Filtering Query (http:// www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery) and the Global Query Filter (http://www.sqlalchemy.org/trac/wiki/UsageRecipes/ GlobalFilter) recipes from

Re: [sqlalchemy] condition on every query

2011-02-20 Thread Michael Bayer
On Feb 20, 2011, at 6:44 PM, robert wrote: I'm looking for a way to add a condition to every query, including child queries. I've tried both the Pre-Filtering Query (http:// www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery) and the Global Query Filter

[sqlalchemy] self-referential relationship w/ declarative style

2011-02-20 Thread Ryan
I'm attempting a self-referential mapping on a Client object that includes these two columns: id = Column(Integer, primary_key=True) inviter_id = Column(Integer, ForeignKey('users.id'), nullable=True) Started here with no luck: inviter = relationship('Client', primaryjoin='Client.id ==

[sqlalchemy] Re: condition on every query

2011-02-20 Thread robert
On Feb 20, 8:59 pm, Michael Bayer mike...@zzzcomputing.com wrote: the cleanest and most foolproof way is to join on relationships that have the condition: related_non_deleted = relationship(Related, primaryjoin=and_(Related.deleted==False, Related.foo_id==id), viewonly=True) I agree that

[sqlalchemy] Is it possible to have single transaction across several http calls?

2011-02-20 Thread Andrey Gladilin
I have a big RESTfull API in my python web application using Werkzeug and SQLAlchemy. Could you advise some way to use a single transaction across several http calls? Thanks! -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group,