[sqlalchemy] Re: multiple foreign references to the same table

2008-09-27 Thread adolfo
That was of great help. Thanks a lot!! Adolfo On Sep 27, 9:04 am, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Sep 26, 2008, at 9:02 PM, adolfo wrote: > > > > > Hello, and sorry if this issue is already covered. > > I have a table which makes foreign references to other table, and I   > > need

[sqlalchemy] Re: Custom type definition and "can't adapt 'INSERT INTO...." error

2008-09-27 Thread Sean Davis
On Sep 27, 5:16 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Sep 27, 2008, at 3:12 PM, Sean Davis wrote: > > > > > > > I have been playing with new types using sqlalchemy and have an error > > I do not understand.  Table schema and type definition are here: > > > ---

[sqlalchemy] Re: Problem with query and lazyload

2008-09-27 Thread Mike Bernson
I am working on recreating the problem. It is not quite as simple as I thought. I have both mapper extension, and event listener going. Also there is a backref between the parent and child. It may take a while but I am working on creating a standalone program that creates the problem. Michael

[sqlalchemy] Re: reflection unavailable for mysql temporary tables?

2008-09-27 Thread Andy Davidoff
Perfect, thank you! On Sep 27, 2:28 pm, jason kirtland <[EMAIL PROTECTED]> wrote: > Andy Davidoff wrote: > > Reflection of temporary tables under MySQL works around revision 4000 > > and probably as recently as May but doesn't seem to work under > > revision 5000 or later; I get a NoSuchTableErr

[sqlalchemy] A Table that recursively backref's itself

2008-09-27 Thread dasacc22
Hi, I was trying to do something like this class Folder(Base): __tablename__ = 'folder' id = Column(Integer, primary_key=True) name = Column(String) folder_id = Column(Integer, ForeignKey('folder.id')) #folder = relation(Folder, backref=backref('folder', order_by=id))

[sqlalchemy] Re: Problem with query and lazyload

2008-09-27 Thread Michael Bayer
Attached is a script that attempts to imitate as close as I can tell to what you are asking (and the end result is correct). Modify it to illustrate your exact issue. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

[sqlalchemy] Re: Custom type definition and "can't adapt 'INSERT INTO...." error

2008-09-27 Thread Michael Bayer
On Sep 27, 2008, at 3:12 PM, Sean Davis wrote: > > I have been playing with new types using sqlalchemy and have an error > I do not understand. Table schema and type definition are here: > > - > > def generate_uuid(): >return uuid.uuid1() > > class GU

[sqlalchemy] Custom type definition and "can't adapt 'INSERT INTO...." error

2008-09-27 Thread Sean Davis
I have been playing with new types using sqlalchemy and have an error I do not understand. Table schema and type definition are here: - def generate_uuid(): return uuid.uuid1() class GUID(sa.types.TypeEngine): def __init__(self): pass

[sqlalchemy] Re: reflection unavailable for mysql temporary tables?

2008-09-27 Thread jason kirtland
Andy Davidoff wrote: > Reflection of temporary tables under MySQL works around revision 4000 > and probably as recently as May but doesn't seem to work under > revision 5000 or later; I get a NoSuchTableError. Is this change > intentional? > > If the only change I make to my code is to create an

[sqlalchemy] Re: problem with mapped object in different database.

2008-09-27 Thread Mike Bernson
They are all mysql INNODB with the same table schemas. I modify the code to not bind the metadata and use the same metadata object for all session attached to databases with the same table schemas. When I need a new table object I call Table with autoload=True, autoload_with=engine This looks

[sqlalchemy] Problem with query and lazyload

2008-09-27 Thread Mike Bernson
I have a problem with row coming back form mapped class that has relations. The session is created with: self.session = Session(bind=self._engine, autoflush=False, _enable_transaction_accounting=False, autocommit=True, weak_identity_map=True) The problem occurs with insta

[sqlalchemy] multiple foreign references to the same table

2008-09-27 Thread adolfo
Hello, and sorry if this issue is already covered. I have a table which makes foreign references to other table, and I need to make a filter against that table multiple times. so I have: q1=session.query(Fuente).outerjoin(Fuente.PPersona, aliased=True).outerjoin(Fuente.PPersona_como_fuente, alias

[sqlalchemy] Re: multiple foreign references to the same table

2008-09-27 Thread Michael Bayer
On Sep 26, 2008, at 9:02 PM, adolfo wrote: > Hello, and sorry if this issue is already covered. > I have a table which makes foreign references to other table, and I > need to make a filter against that table multiple times. > > so I have: > > q1=session.query(Fuente).outerjoin(Fuente.PPersona

[sqlalchemy] Re: problem with mapped object in different database.

2008-09-27 Thread Michael Bayer
On Sep 27, 2008, at 12:35 AM, Mike Bernson wrote: > > I have a number of database that have the same tables in them. > > I create a session for 1 data and do some work. This work causes > a number of table table object to be reflected from the database > and then mapped. This works fine. > > Now