[sqlalchemy] Re: Managing transactions from Session using raw_connections

2010-12-07 Thread Ralph Heinkel
Hi Michael, thanks for your help. Since some of my engines are not bound to mappers I've tried the approach suggested in your previous post to subclass Session so that 'get_bind' would accept an additional 'engine' argument. This works fine with Session.execute() which passes **kw down to the

[sqlalchemy] Re: Trouble detaching all objects with relationships intact

2010-12-07 Thread Ian Thompson
On Dec 6, 5:53 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 6, 2010, at 11:52 AM, Ian Thompson wrote: On Dec 6, 4:49 pm, Ian Thompson quorn...@gmail.com wrote: I've generated a test data set and then want to have all of the created objects and relationships available for

[sqlalchemy] Re: Problem with one relation

2010-12-07 Thread Alvaro Reinoso
The relation is OK, one-to-many between Playlist and PlaylisItem. However, PlaylistItem can contain one Playlist or one Layout and that Playlist could be in many PlaylistItems. I know it's weird relation if I already have Playlist as parent of PlaylistItem, but could I get this? Thanks! On Dec

Re: [sqlalchemy] Re: Managing transactions from Session using raw_connections

2010-12-07 Thread Michael Bayer
when I answered your email I realized we should probably add a bind argument to connection() and execute(), for those cases where you have the actual bind (and the kw, for subclass situations). ticket #1996 On Dec 7, 2010, at 7:32 AM, Ralph Heinkel wrote: Hi Michael, thanks for

Re: [sqlalchemy] Re: Trouble detaching all objects with relationships intact

2010-12-07 Thread Michael Bayer
On Dec 7, 2010, at 7:46 AM, Ian Thompson wrote: On Dec 6, 5:53 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 6, 2010, at 11:52 AM, Ian Thompson wrote: On Dec 6, 4:49 pm, Ian Thompson quorn...@gmail.com wrote: I've generated a test data set and then want to have all of

Re: [sqlalchemy] Re: Problem with one relation

2010-12-07 Thread Michael Bayer
On Dec 7, 2010, at 10:09 AM, Alvaro Reinoso wrote: The relation is OK, one-to-many between Playlist and PlaylisItem. However, PlaylistItem can contain one Playlist or one Layout and that Playlist could be in many PlaylistItems. I know it's weird relation if I already have Playlist as parent

[sqlalchemy] table inheritance

2010-12-07 Thread Tarek Ziadé
Hey, I have a declarative table called 'Foo': _Base = declarative_base() class Foo(_Base): __tablename__ = 'foo' __table_args__ = {'mysql_engine': 'InnoDB', 'mysql_charset': 'latin1'} id = Column(String(64), primary_key=True, autoincrement=False)

Re: [sqlalchemy] table inheritance

2010-12-07 Thread Michael Bayer
This is the entity name recipe, and we have a classical and declarative version over at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName . It's using just the straight type() factory. You definitely want to use distinct Column objects for each class, this because a Column

Re: [sqlalchemy] table inheritance

2010-12-07 Thread Tarek Ziadé
On Tue, Dec 7, 2010 at 5:08 PM, Michael Bayer mike...@zzzcomputing.com wrote: This is the entity name recipe, and we have a classical and declarative version over at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName .    It's using just the straight type() factory. You definitely

Re: [sqlalchemy] Re: Managing transactions from Session using raw_connections

2010-12-07 Thread Michael Bayer
I hadn't planned any future 0.5 releases, 0.7 is almost ready for betas. What are the incompatibilities you have with 0.6 ? On Dec 7, 2010, at 11:58 AM, Ralph Heinkel wrote: This would be great! Thanks, Michael! (is this also going into the 0.5.x branch - we are not yet able to upgrade

[sqlalchemy] composite property not working on a mapped select

2010-12-07 Thread Will
Hello, I've been trying to map two tables that have 25 columns each in addition to keys. The parent table's (descriptions) column values represent the key in a dictionary and the child table's (values) column values represent the values of the dictionary. i.e.: table 'descriptions':

[sqlalchemy] Re: Problem with one relation

2010-12-07 Thread Alvaro Reinoso
Yes, that's what I want. I already have the two relations that I want.: One is in Playlist, items = relationship(PlaylistItem, cascade=all, delete, backref=playlists). If I understand properly, this allows Playlist to contain PlaylistItems And the another one is in PlaylistItem, playlist =

Re: [sqlalchemy] Failing test - SQLAlchemy 0.5.8, python 2.7.0

2010-12-07 Thread Martin Bacovsky
On Thursday, November 25, 2010 02:29 am, Michael Bayer wrote well I'd just take those tests out of 0.5 , I'm not sure if theres any other way to affect the outcome of nosetests without modifying SQLA code or tests directly. I finally had time to resolve this. Link to my patch (just for

Re: [sqlalchemy] composite property not working on a mapped select

2010-12-07 Thread Michael Bayer
its a bug, and theres a new ticket http://www.sqlalchemy.org/trac/ticket/1997 with a small patch. I would suggest maybe not using composites for this for now. Most of what composite does you can accomplish using descriptors: class Value(object): @property def custom_values(self):