[sqlalchemy] Re: Changing Python type associated with temporal datatypes without using custom TypeDecorator?

2009-04-25 Thread az
this direct yourmodels.DateType replacement would work if u had that in some separate file, and all your models imported from that one. But, as there's probably lots of other code and the import DateTime is probably everywhere, i dont think u know which DateTime's to be replaced and which not.

[sqlalchemy] Overriding reflected columns in SqlSoup?

2009-04-25 Thread Stephen Emslie
I am using SqlSoup to do a little maintenance on a database whose schema I have no control over. Unfortunately some tables are without a primary key, and thus SqlSoup complains when accessing them: sqlalchemy.ext.sqlsoup.PKNotFoundError: table 'category' does not have a primary key defined When

[sqlalchemy] Re: pyodbc issues

2009-04-25 Thread Michael Trier
On Apr 24, 2009, at 7:50 PM, Michael Mileusnich justmike2...@gmail.com wrote: Wow..your example worked for me. Could the kwargs the issue? No. Likely you have some sort of conflict on the dbapi side. If it's possible for you to send me your actual code (mtr...@gmail.com) I'd be happy to

[sqlalchemy] Re: Revers Dialect - SQL Interpreter

2009-04-25 Thread Michael Bayer
this just came out recently http://code.google.com/p/python-sqlparse/ On Apr 24, 2009, at 9:36 PM, Jarrod Chesney wrote: Hi all again. I have a program that has a UI and allows the user to do some data or metadata manipulations. This is ok if the user (me) wants to make a couple of

[sqlalchemy] Re: pyodbc issues

2009-04-25 Thread Michael Mileusnich
I added the metadata.create_all() to me function that returns the session and everything seems to insert...I thought the metadata.create_all was only used to create the tables? On Sat, Apr 25, 2009 at 8:05 AM, Michael Trier mtr...@gmail.com wrote: On Apr 24, 2009, at 7:50 PM, Michael

[sqlalchemy] association_proxy with association object - declarative

2009-04-25 Thread GHZ
I tried to use the example from: http://www.sqlalchemy.org/docs/05/reference/ext/associationproxy.html#simplifying-association-object-relations But with declarative syntax. Any idea why this is going wrong? from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey, Sequence,

[sqlalchemy] Executing a PostgreSQL Function

2009-04-25 Thread Eric
I have a function in a PostgreSQL DB I need to execute that returns nothing. I was told by peers that this is the proper way to do it: meta.Session.execute(SELECT sp_add_tag('%s', '%s', '%s') % (user.id, self.id, value.lower() )) BUT this gives us issues with characters like single quotes and

[sqlalchemy] Re: association_proxy with association object - declarative

2009-04-25 Thread Michael Bayer
try: def _create_uk_by_keyword(keyword): A creator function. We expect keywords to already be in the DB.. therefore, just search and return the existing keyword return UserKeyword (keyword=session.query(Keyword).filter_by(keyword=keyword).one()) On Apr 25, 2009, at 7:05 PM,

[sqlalchemy] Re: Executing a PostgreSQL Function

2009-04-25 Thread Michael Bayer
the func construct described in the documentation is the usual way to render any SQL function, such as sess.execute(func.sp_add_tag(user.id, self.id, value.lower())) On Apr 25, 2009, at 11:16 PM, Eric wrote: I have a function in a PostgreSQL DB I need to execute that returns nothing. I