[sqlalchemy] Re: Querying for the existence of an object in the database

2008-04-01 Thread pyplexed
On Mar 31, 2008, at 12:02 PM, pyplexed wrote: The continuing adventures of a newbie SA user... Could anyone tell me if there is a simple way of setting up a query which takes an object as an argument and checks for the existence of an object in the database? by primary key ?

[sqlalchemy] Re: MSSQL, pyodbc linux

2008-04-01 Thread Lukasz Szybalski
On Mon, Mar 31, 2008 at 4:57 PM, Rick Morrison [EMAIL PROTECTED] wrote: You are correct: Port= fixes it. If you guys could fix this in svn, and point me to some instructions on how to install sqlalchemy in virtual / home directory that would be great. OK, great,

[sqlalchemy] Re: Querying for the existence of an object in the database

2008-04-01 Thread Michael Bayer
On Apr 1, 2008, at 2:09 AM, pyplexed wrote: Actually, I would know the type, so maybe that makes it simpler. I'm in a situation where I want to store data which is generated externally to my system, and which is polled regularly but individual items change relatively infrequently. It

[sqlalchemy] Re: MSSQL, pyodbc linux

2008-04-01 Thread Rick Morrison
or sqlalchemy connection string will have to provide some way to add a driver name to connection string. sqlalchemy.create_engine('mssql://user:[EMAIL PROTECTED]:1433/?driver=TDS') That capability, with that very keyword, is in SVN trunk, part of the last round of changes. BTW, this string

[sqlalchemy] updating relate table data in a foreign session

2008-04-01 Thread sniffer
hi all, first of all thanks for the replies to my last question,now i have a different problem although not entirely different i again have a two host model where the query objects from 1 host are sent to the other host and added to the database there in.this works fine with individual tables

[sqlalchemy] Re: updating relate table data in a foreign session

2008-04-01 Thread Michael Bayer
On Apr 1, 2008, at 10:01 AM, sniffer wrote: hi all, first of all thanks for the replies to my last question,now i have a different problem although not entirely different i again have a two host model where the query objects from 1 host are sent to the other host and added to the

[sqlalchemy] Re: MSSQL, pyodbc linux

2008-04-01 Thread Lukasz Szybalski
On Tue, Apr 1, 2008 at 9:26 AM, Rick Morrison [EMAIL PROTECTED] wrote: or sqlalchemy connection string will have to provide some way to add a driver name to connection string. sqlalchemy.create_engine('mssql://user:[EMAIL PROTECTED]:1433/?driver=TDS') That capability, with that

[sqlalchemy] Re: MSSQL, pyodbc linux

2008-04-01 Thread Lukasz Szybalski
On Tue, Apr 1, 2008 at 10:09 AM, Lukasz Szybalski [EMAIL PROTECTED] wrote: On Tue, Apr 1, 2008 at 9:26 AM, Rick Morrison [EMAIL PROTECTED] wrote: or sqlalchemy connection string will have to provide some way to add a driver name to connection string.

[sqlalchemy] Re: MSSQL, pyodbc linux

2008-04-01 Thread Rick Morrison
Under: http://www.sqlalchemy.org/docs/04/documentation.html#dbengine_establishing snip changes Thanks, I'll add these. I guess my last question is how do I use sqlalchemy now? Is there a release that is coming out soon that would include unixodbc support or should I use svn? If I

[sqlalchemy] Re: Querying for the existence of an object in the database

2008-04-01 Thread Michael Bayer
im actually making a change to merge() that also might help you with this particular issue. stay tuned for that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] Re: sqlalchemy in virtualenv

2008-04-01 Thread Rick Morrison
This is really a question for the virtual-env list, not here, but For your python setup.py install You must run this using the python executable from the new private directory, not the system python executable. Same thing when you run the python interpreter where you wish to do the local

[sqlalchemy] sqlalchemy in virtualenv

2008-04-01 Thread Lukasz Szybalski
Hello, I am trying to use sqlalchemy from svn. I have checkout the code in /home/lucas/tmp/sqlalchemy I installed python-virtualenv I created my virtualenv python /usr/lib/python2.4/site-packages/virtualenv.py ENV I install sqlalchemy export

[sqlalchemy] Re: MSSQL, pyodbc linux

2008-04-01 Thread Paul Johnston
Hi Lukasz, Under: http://www.sqlalchemy.org/docs/04/documentation.html#dbengine_establishing after: # oracle will feed host/port/SID into cx_oracle.makedsn oracle_db = create_engine('oracle://scott:[EMAIL PROTECTED]:1521/sidname') It's great to see you getting MSSQL to work on Unix. I know

[sqlalchemy] Circular table dependencies and ext.declarative

2008-04-01 Thread Bobby Impollonia
Hi. I am using sqlalchemy with a database that has two tables that each have foreign keys on the other. The situation this is modeling is a tree where the levels alternate between two different types of node. Each Node1 has a parent of type Node2 (or null for the root) and each Node2 has a parent

[sqlalchemy] Re: Circular table dependencies and ext.declarative

2008-04-01 Thread Michael Bayer
On Apr 1, 2008, at 5:59 PM, Bobby Impollonia wrote: This fails (as expected) because of the circular dependency. Before I switched to declarative, I had solved this by using a ForeignKeyConstraint with use_alter. I can't see how to do that with declarative. I tried changing Node2 to:

[sqlalchemy] Re: Circular table dependencies and ext.declarative

2008-04-01 Thread Bobby Impollonia
Awesome, putting use_alter on one of the foreign keys fixed the problem. Would it be hard to just assume that when there is a circular dependency that one of the keys should be use_alter'ed? Is there actually a case where that be the wrong thing to do (or any reason I would care which of the

[sqlalchemy] Re: Circular table dependencies and ext.declarative

2008-04-01 Thread Michael Bayer
On Apr 1, 2008, at 7:25 PM, Bobby Impollonia wrote: Awesome, putting use_alter on one of the foreign keys fixed the problem. Would it be hard to just assume that when there is a circular dependency that one of the keys should be use_alter'ed? Is there actually a case where that be the

[sqlalchemy] Re: 0.3.9 to 0.4.4 ... instance already persistent when calling save()

2008-04-01 Thread johnnyice
I got my web app migrated to pylons 0.9.6.1 and sqlalchemy 0.4.4 with the exception of a few calls. As I included the code example in my first post, for some reason the object does not want to obtain the id it was given when saved. heading = Heading('Text') heading.page

[sqlalchemy] Re: 0.3.9 to 0.4.4 ... instance already persistent when calling save()

2008-04-01 Thread Michael Bayer
On Apr 1, 2008, at 8:19 PM, johnnyice wrote: I got my web app migrated to pylons 0.9.6.1 and sqlalchemy 0.4.4 with the exception of a few calls. As I included the code example in my first post, for some reason the object does not want to obtain the id it was given when saved.