RE: [sqlalchemy] trouble with metaclass

2011-03-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of farcat Sent: 16 March 2011 21:01 To: sqlalchemy Subject: [sqlalchemy] trouble with metaclass I have an error i cant figure out (likely a beginners error):

Re: [sqlalchemy] In-memory object duplication

2011-03-17 Thread Jacques Naude
Hi, Simon Thanks for the quick response. Elixir doesn't use __init__ - there's something automatic going on there. My create(), in essence, does the job of __init__, which means you might still be hitting the nail on the head. I haven't had the time to test it out yet, but I will. (Why, though,

[sqlalchemy] Re: Association proxy like for integer/string/types list

2011-03-17 Thread zaza witch
Thanks ! To respond to my needs, it becomes : class NodeAttribute(Base): __tablename__ = 'node_attribute' node_id = Column('n_id', Integer, ForeignKey('node.n_id'), primary_key=True) attribute = Column('na_id', String, primary_key=True) def __init__(self,

[sqlalchemy] Re: subquery as a mapper property

2011-03-17 Thread hoesley
Awesome, thank you much. It is correlated to the parent. The query- enabled properties section looks interesting to me. Will there be a significant performance difference between the two approaches? I want this to be lazily evaluated, so that this information is never fetched unless we actually

RE: [sqlalchemy] In-memory object duplication

2011-03-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Jacques Naude Sent: 17 March 2011 12:32 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] In-memory object duplication Hi, Simon Thanks for the quick response.

Re: [sqlalchemy] trouble with metaclass

2011-03-17 Thread Chris Withers
On 16/03/2011 21:01, farcat wrote: I have an error i cant figure out (likely a beginners error): Beginners should not be using metaclasses. What's your use case here? Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk --

Re: [sqlalchemy] Re: attribute not updating

2011-03-17 Thread Michael Bayer
You need to create a single file Python script, which creates a CoverBatchStackItem class with just two columns - id and qty.Then, it inserts one row into a local sqlite database, then loads, updates qty in the manner in which you describe, and commits. Use the examples in the object

Re: [sqlalchemy] Re: subquery as a mapper property

2011-03-17 Thread Michael Bayer
On Mar 17, 2011, at 11:05 AM, hoesley wrote: Awesome, thank you much. It is correlated to the parent. The query- enabled properties section looks interesting to me. Will there be a significant performance difference between the two approaches? I want this to be lazily evaluated, so that this

[sqlalchemy] Re: Getting instances that contains other instances in an N:M relationship

2011-03-17 Thread Hector Blanco
Got it: query = session.query(Store.Store) query = query.join('userGroups', 'users') query = query.filter(User.User.id == int(userId)) print str(query.all()) From the examples inside the sqlalchemy egg (http://prdownloads.sourceforge.net/sqlalchemy/SQLAlchemy-0.6.6.tar.gz?download) In the

[sqlalchemy] ResourceClosedError with large Text columns

2011-03-17 Thread Martin
I have a table with a Text column, which i manually set up as a MEDIUMTEXT type in MySQL (5.0), since MySQL's 2**16 character limit is not enough for my application. Now when I store large chunks of text in that column, and try to get it back, SQLAlchemy raises an ResourceClosedError, saying that

Re: [sqlalchemy] ResourceClosedError with large Text columns

2011-03-17 Thread Michael Bayer
On Mar 17, 2011, at 9:11 PM, Martin wrote: I have a table with a Text column, which i manually set up as a MEDIUMTEXT type in MySQL (5.0), since MySQL's 2**16 character limit is not enough for my application. Now when I store large chunks of text in that column, and try to get it back,

[sqlalchemy] Howto identify connection which has not been returned back to the pool?

2011-03-17 Thread Jaimy Azle
Dear All, Having a logging functionality to trace creation, checkout, and checkin connection from pool is very helpfull. however is there a way to identify connection which has not been returned back to the pool for a period of time? I suspect I had a stale connection object which does not