[sqlalchemy] Re: Associations in a cleaner way

2007-03-05 Thread King Simon-NFHD78
Knut Aksel Røysland wrote: [snip] However, an instance of D also needs a reference to an instance of C. If the appropriate instance of C exists in the database (or is pending to go into it), I want to pick this one, or otherwise create a new instance of C. What I am looking for is

[sqlalchemy] Re: Support for incomplete dates

2007-03-05 Thread Michael Bayer
in most cases the DBAPI driver, not SA, is the one returning the Python datetime objects to you. also like Rick said most DBs are not going to store an invalid date. so if you arent storing an actual date, you probably dont want to declare those columns as Date columns. On Mar 4, 2007,

[sqlalchemy] Re: specifying a primary key, keepinging client/server in sync

2007-03-05 Thread Michael Bayer
On Mar 4, 2007, at 9:58 PM, rgravina wrote: I was wondering if it is possible to specify a primary key manually? sure, just set whatever column-based attributes you like before flushing...such as if your table's primary key column is named some_id, you could say: myobject.some_id = 7

[sqlalchemy] Re: query on self-referencing polymorphic mapper

2007-03-05 Thread svilen
ok, that solves some things, i won't need those ultra-explicit selects() now. The other problem remains: union's mechanism for corresponding_column() takes ownership of all columns mentioned in the WHERE, regardless if they are from a table within the union/join, or in alias of that table.

[sqlalchemy] Ping

2007-03-05 Thread percious
I need to ping the Mysql database to keep it alive. Is there a simple way to do this with SA? -chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: Ping

2007-03-05 Thread Sébastien LELONG
I need to ping the Mysql database to keep it alive. Is there a simple way to do this with SA? Maybe you'd want to have a look at the pool_recycle argument of create_engine. It'll make the connection pool beeing checked if active, and potentially recycle the connections if they are too old.

[sqlalchemy] Re: query on self-referencing polymorphic mapper

2007-03-05 Thread Michael Bayer
On Mar 5, 2007, at 11:58 AM, svilen wrote: The other problem remains: union's mechanism for corresponding_column() takes ownership of all columns mentioned in the WHERE, regardless if they are from a table within the union/join, or in alias of that table. i.e. all columns mentioned in the

[sqlalchemy] rev2309 breaks some of the A-B ref/inh cases

2007-03-05 Thread Pete Taylor
in regard to post-2309 revisions and the foreignkey keyword deprecation... I know this conversation seems to have terminated as of 2/21, but it's the only thread that was tracing through a problem i'm having. I'm certain my problem is just one of my own lack of understanding on how to use

[sqlalchemy] Re: rev2309 breaks some of the A-B ref/inh cases

2007-03-05 Thread Michael Bayer
please forward an runnable example test case, preferably a single file with 200 lines if possible. you're also making usage of Column instances directly off the selectable youre mapping, right ? On Mar 5, 2007, at 1:55 PM, Pete Taylor wrote: in regard to post-2309 revisions and the

[sqlalchemy] Copying from one database format to another

2007-03-05 Thread Adam Peacock
Is there a tool for SA to copy from one database to another? I'm looking for a simple way to propogate my testing database (sqlite) from my production database (postgres), so that I can play with actual data during testing without worrying about what I'm going to mess up. Is there an automated

[sqlalchemy] Re: rev2309 breaks some of the A-B ref/inh cases

2007-03-05 Thread Pete Taylor
yessir, when using selectables i always just use selectobj.c.colname... i've attached a quick test case, and it throws the same error that my live code does, so it at least proves i can break things the same way twice :D i wouldn't be surprised if it's something easy that i'm just doing wrong,

[sqlalchemy] Re: rev2309 breaks some of the A-B ref/inh cases

2007-03-05 Thread Michael Bayer
no problem, that test uncovered a place I could ratchet things down some more so everybody wins. you want rev 2383. On Mar 5, 2007, at 3:09 PM, Pete Taylor wrote: yessir, when using selectables i always just use selectobj.c.colname... i've attached a quick test case, and it throws the

[sqlalchemy] Desktop apps with SQLachemy?

2007-03-05 Thread iainduncan
I'm wondering if anyone can suggest the best tools or way to make python desktop db apps using sqlalchemy, and in a manner that is as close to turbogears or pylons as possible. I would like to be able to offer desktop internal apps that playfair with TG based sites. I use wxWidgets already in

[sqlalchemy] Re: Dynamically building a query with a join

2007-03-05 Thread Michael Bayer
there is append_from() joins know how to find their components that are already in the selectable and replace them. On Mar 5, 2007, at 4:38 PM, Dennis wrote: I'm playing around with dynamically building a query. I can append columns, where clauses, from objects etc... but what about the

[sqlalchemy] Re: Dynamically building a query with a join

2007-03-05 Thread Dennis
Actually, I'm still having a problem because the primary object is already a join and the next object that I append gets listed twice. Example sel=select([a,b], from_obj=[a.outerjoin(b)]) sel.append( a.outerjoin(c,somecriteriaforthejoin)) str(sel) SELECT ,,, FROM a LEFT OUTER JOIN b ON , a

[sqlalchemy] Re: Dynamically building a query with a join

2007-03-05 Thread Dennis
I did find a slight hack: query.append_from ( query.froms._list[0].outerjoin( etc ... ) ) -Dennis On Mar 5, 3:54 pm, Dennis [EMAIL PROTECTED] wrote: Actually, I'm still having a problem because the primary object is already a join and the next object that I append gets listed twice.

[sqlalchemy] Polymorphic collections / ticket #500

2007-03-05 Thread Rick Morrison
The fix for ticket #500 breaks a pattern I've been using. It's most likely an anti-pattern, but I don't see a way to get what I want in SA otherwise. I've got a series of entities class Person(): pass class Manager(Person): def __init__(self): # do manager stuff class

[sqlalchemy] sa newbie

2007-03-05 Thread dan
I'm trying to track down the syntax for using a 'like' clause with sql soup. I'm trying to do something like select book_sku from books where book_sku like 'abcd%'; best i can tell, my syntax should look something like: skus = db.books.select(book_skus.like('abcd%')) but I'm getting an