[sqlalchemy] Re: Problems/Bug in ordering_list (UNIQUE KEY violation)

2009-03-10 Thread oberger
Thank's for your answer. On 27 Feb., 02:14, jason kirtland j...@discorporate.us wrote: Michael Bayer wrote: On Feb 19, 2009, at 4:33 PM, oberger wrote: Thank you Michael, but I am not able to bring this to work. Even with a flush and a commit after every Statement. I understand

[sqlalchemy] Re: Using sqlalchemy in twisted.

2009-03-10 Thread 一首诗
Hi Jeff, Thanks for your kind suggestion. I first add some log decorators, but i found when it might cause to print sqalchemy objects which has not been bound to any session. And I am not quite sure about how to make the decorator mor genreal. Actually, I think I must use model as the first

[sqlalchemy] Suggestions on using a dialect outside of the Alchemy installation tree

2009-03-10 Thread phrrn...@googlemail.com
Hi, I have done a fair bit on a Sybase ASE dialect for Alchemy and it is now in a primitive but usable condition for simple applications. My employers are fine with contributing the code back to the project and I intended to coordinate with Mike Bayer about this shortly. In the meantime, we would

[sqlalchemy] Re: Suggestions on using a dialect outside of the Alchemy installation tree

2009-03-10 Thread Michael Bayer
you can install the dialect using a setuptools entry point. SQLAlchemy looks for dialect modules using the sqlalchemy.databases entry point name, so in this case you might name it sqlalchemy.databases.sybase-ase. phrrn...@googlemail.com wrote: Hi, I have done a fair bit on a Sybase ASE

[sqlalchemy] Re: Suggestions on using a dialect outside of the Alchemy installation tree

2009-03-10 Thread phrrn...@googlemail.com
Thanks Mike. This sounds great although I have to admit that I don't follow it completely as I have not used authored anything via setuptools. If this is trivial for you, could you sketch out what this would look like? pjjH On Mar 10, 11:25 am, Michael Bayer mike...@zzzcomputing.com wrote:

[sqlalchemy] Inheritance and binds to several engines

2009-03-10 Thread Denis S. Otkidach
I use declarative to define database scheme, and binds parameter to session constructed from several metadata tables lists. And I have a problem with inherited models, where table is represented as Join object: get_bind() method doesn't find an engine. A quick-n-dirty solution I use is: class

[sqlalchemy] Re: Suggestions on using a dialect outside of the Alchemy installation tree

2009-03-10 Thread jason kirtland
It'd look like this: http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_sa/setup.py Your dialect will be available to SA after you 'python setup.py install' or 'python setup.py develop' in your -ase distribution. phrrn...@googlemail.com wrote: Thanks Mike. This sounds great

[sqlalchemy] Re: Suggestions on using a dialect outside of the Alchemy installation tree

2009-03-10 Thread phrrn...@googlemail.com
The quality of the support in this group is remarkable. The answers are starting to remind me of Guy Harris in terms of quality and clarity! (If the name is not familiar to you then check out the Usenet archives from the mid to late 80's) thanks very much. pjjH On Mar 10, 11:34 am, jason

[sqlalchemy] Re: Inheritance and binds to several engines

2009-03-10 Thread Michael Bayer
Denis S. Otkidach wrote: I use declarative to define database scheme, and binds parameter to session constructed from several metadata tables lists. And I have a problem with inherited models, where table is represented as Join object: get_bind() method doesn't find an engine. A

[sqlalchemy] Using order_by in an association many-to-many relationship with columns from the association object

2009-03-10 Thread Scott
Is there a way with the current iteration of SQLAlchemy to add a column to the association table in a many-to-many relationship with that column used to order the join? I looked at the order_by attribute of the ManyToMany() relationship definition, but it seems that this is expecting a string

[sqlalchemy] Re: Using order_by in an association many-to-many relationship with columns from the association object

2009-03-10 Thread Michael Bayer
order_by accepts a Column object, i.e. table.c.whatever, so pass that in. Scott wrote: Is there a way with the current iteration of SQLAlchemy to add a column to the association table in a many-to-many relationship with that column used to order the join? I looked at the order_by attribute

[sqlalchemy] GUID creation causing foreign key errors

2009-03-10 Thread Bryan
The primary keys in my db are GUIDs, char(36). When I generate the GUID in python using the uuid module, everything works fine. But when I allow the db to generate the GUIDs I get foreign key errors when trying to save a new parent and child. A look at the SQL generated shows that the parent

[sqlalchemy] Using Alchemy across tens of thousands of tables, hundreds of databases and dozens of dataservers.

2009-03-10 Thread phrrn...@googlemail.com
Thanks to all the help from the group, I am now facing an issue much earlier than anticipated: how to manage Alchemy in -- apologies for using a dreadfully overused phrase -- an 'Enterprise Setting'. This really boils down to matters of scale: tens of thousands of tables in hundreds of databases

[sqlalchemy] Re: GUID creation causing foreign key errors

2009-03-10 Thread Michael Bayer
I would qualify this as a bug since the compiler should be executing the guid() function externally to the INSERT statement, since its newly generated value is required as a return value - this is ticket 1335. Note that pre-execution of the guid function is required here. You can force this

[sqlalchemy] Re: Supporting fully-qualified table names and cross-database references in Sybase and SQL Server?

2009-03-10 Thread phrrn...@googlemail.com
As it happens, this works on the Sybase dialect without fixing the quoting at all! Apparently SQL such as this is happily accepted by Sybase: SELECT [fdcommon.dbo].organization.org_id, [fdcommon.dbo].organization.abbrev FROM [fdcommon.dbo].organization JOIN [fdcommon.dbo].org_type ON