Re: [sqlalchemy] Merge support with ConcreteInheritedProperty

2010-08-02 Thread Kent Bower
Excellent. The 'pass' ConcreteInheritedProperty.merge() method works fine. Thanks again. On 8/1/2010 2:24 PM, Michael Bayer wrote: On Jul 31, 2010, at 7:41 AM, Kent wrote: When I call merge() on an ArTran object, the merge() method of a ConcreteInheritedProperty 'artransarchiveid' that

[sqlalchemy] Declarative syntax with column_property (v0.6.3)

2010-08-02 Thread Robert Sudwarts
Hi, I'm having trouble understanding the correct syntax to be used with Declarative and a column property. The select statement I'm using is: select([func.substr(my_table.c.my_string, 2, 3)]).label(my_substr'), deferred=True And (as per the docs using the expanded syntax, this works as expected.

[sqlalchemy] Returning an attribute from an object when using query_property()?

2010-08-02 Thread Zippy P
Hi all: I have the following code: class EventQuery(Query): def histogram(self): ''' return a histogram of source / count(source) given an eventquery'' ... ... class Event(Base): __tablename__ = 'events' query = Session.query_property(query_cls = EventQuery) name =

Re: [sqlalchemy] Returning an attribute from an object when using query_property()?

2010-08-02 Thread Michael Bayer
On Aug 2, 2010, at 12:41 PM, Zippy P wrote: Hi all: I have the following code: class EventQuery(Query): def histogram(self): ''' return a histogram of source / count(source) given an eventquery'' ... ... class Event(Base): __tablename__ = 'events' query =

Re: [sqlalchemy] Declarative syntax with column_property (v0.6.3)

2010-08-02 Thread Michael Bayer
On Aug 2, 2010, at 12:19 PM, Robert Sudwarts wrote: Hi, I'm having trouble understanding the correct syntax to be used with Declarative and a column property. The select statement I'm using is: select([func.substr(my_table.c.my_string, 2, 3)]).label(my_substr'), deferred=True And (as

[sqlalchemy] Re: Returning an attribute from an object when using query_property()?

2010-08-02 Thread SQLAlchemy User
I have the following code: class EventQuery(Query):   def histogram(self):     ''' return a histogram of source / count(source) given an eventquery''     ... ... class Event(Base):   __tablename__ = 'events'   query = Session.query_property(query_cls = EventQuery)   name =

Re: [sqlalchemy] Re: Returning an attribute from an object when using query_property()?

2010-08-02 Thread Michael Bayer
On Aug 2, 2010, at 1:58 PM, SQLAlchemy User wrote: I ha Thanks, Michael. Two followup questions: 1) The histogram() method is designed to provide statistics on a set of Events (defined by a query), so it made sense (to me) to make it a method of EventQuery. I don't know how I'd do this as

Re: [sqlalchemy] Declarative syntax with column_property (v0.6.3)

2010-08-02 Thread Michael Bayer
On Aug 2, 2010, at 1:40 PM, Michael Bayer wrote: On Aug 2, 2010, at 12:19 PM, Robert Sudwarts wrote: Hi, I'm having trouble understanding the correct syntax to be used with Declarative and a column property. The select statement I'm using is:

[sqlalchemy] Re: Returning an attribute from an object when using query_property()?

2010-08-02 Thread SQLAlchemy User
On Aug 2, 11:34 am, Michael Bayer mike...@zzzcomputing.com wrote: values() should be using the least amount of memory of any approach - it only buffers 10 rows in memory at a time, and doesn't deal with session or object accounting at all so is also much more performant than all().  I dont

[sqlalchemy] To select only some columns from some tables using session object, relation many-to-many

2010-08-02 Thread Alvaro Reinoso
Hello, I have these classes where items (class Item) is related to channel object. Channel can contain many items: channel_items = Table( channel_items, metadata, Column(channel_id, Integer, ForeignKey(channels.id)), Column(item_id, Integer,

[sqlalchemy] Re: To select only some columns from some tables using session object, relation many-to-many

2010-08-02 Thread Kalium
On Aug 3, 8:43 am, Alvaro Reinoso alvrein...@gmail.com wrote: Hello, I have these classes where items (class Item) is related to channel object. Channel can contain many items: channel_items = Table(         channel_items,         metadata,         Column(channel_id, Integer,