[sqlalchemy] Re: Is there a way to replace object in DB?

2008-01-16 Thread Denis S. Otkidach
On Jan 15, 2008 6:54 PM, Michael Bayer [EMAIL PROTECTED] wrote: The last commit fails with: sqlalchemy.exceptions.IntegrityError: (IntegrityError) Referers.objectId may not be NULL u'UPDATE Referers SET objectId=? WHERE Referers.id = ?' [None, 1] right thats because the instance doesnt

[sqlalchemy] Re: two scoped sessions in one app?

2008-01-16 Thread Max Ischenko
I had a Session.configure() statement which was called for both sessions and this was making setup unusable. Duh. On Jan 16, 2008 2:12 PM, Max Ischenko [EMAIL PROTECTED] wrote: On Jan 15, 2008 6:14 PM, Michael Bayer [EMAIL PROTECTED] wrote: if you are using multiple scoped sessions you

[sqlalchemy] Re: two scoped sessions in one app?

2008-01-16 Thread Max Ischenko
On Jan 15, 2008 6:14 PM, Michael Bayer [EMAIL PROTECTED] wrote: if you are using multiple scoped sessions you won't be able to use Session.mapper - the idea of Session.mapper is that all instances get tied to a single contextual session. OK, so how do I set it up. I'm reading

[sqlalchemy] Re: two scoped sessions in one app?

2008-01-16 Thread Max Ischenko
Hello, Sorry for reply to myself; just want to tell that the problem is solved. Here is how my setup looks like: Session = scoped_session(sessionmaker(autoflush=True, transactional=False)) SessionCDB = scoped_session(sessionmaker(autoflush=True, transactional=False)) ... # application

[sqlalchemy] DBMS

2008-01-16 Thread Manish Soni
Hi, Send me some study material on DBMS. -- Regards, Manish Soni M. Phil.(Computer Science),MCA(Hons.) Master of Science (Computer Science) B.Sc.(Mathematics, Physics, Computer Application) MCPDEA, MCSD(.Net), MCDBA(SQL Server 2000), MCAD(.Net), A Level, OCA(9i) MCP(VB6 Desktop, VB6 Distributed,

[sqlalchemy] Re: eagerloading polymorphic mapper

2008-01-16 Thread Michael Bayer
On Jan 16, 2008, at 2:24 AM, [EMAIL PROTECTED] wrote: yeahhh i know i dont see the wider sql picture... i may put all this as a ticket to remind.. maybe one day you'll be in better mood (;-) it can certainly be done but id like to at least first get eager loads from the *base*

[sqlalchemy] postgresql truncate table

2008-01-16 Thread Alexandre da Silva
someone know why when I execute a session.execute(truncate table some_table cascade) in a postgresql database nothing happens? I need to put some extra parameter? -- Alexandre da Silva Analista de Sistemas - Bacharel em Sistemas de Informação (2003-2007)

[sqlalchemy] Re: Is there a way to replace object in DB?

2008-01-16 Thread Michael Bayer
On Jan 16, 2008, at 4:43 AM, Denis S. Otkidach wrote: On Jan 15, 2008 6:54 PM, Michael Bayer [EMAIL PROTECTED] wrote: The last commit fails with: sqlalchemy.exceptions.IntegrityError: (IntegrityError) Referers.objectId may not be NULL u'UPDATE Referers SET objectId=? WHERE

[sqlalchemy] Connecting to MSSQL with a System DSN on Windows

2008-01-16 Thread Vinay Sajip
I have a Windows setup in which I need to use Integrated Authentication with pyodbc and MSSQL. I have set up a System DSN using the Control Panel and pyodbc connects OK using this DSN - I can run queries etc. without problems. I use the connection string 'DSN=MyDSN' for pyodbc, where MyDSN is the

[sqlalchemy] Re: Connecting to MSSQL with a System DSN on Windows [Solved]

2008-01-16 Thread Vinay Sajip
On 16 Jan, 18:10, Vinay Sajip [EMAIL PROTECTED] wrote: I have a Windows setup in which I need to use Integrated Authentication with pyodbc and MSSQL. I have set up a System DSN using the Control Panel and pyodbc connects OK using this DSN - I can run queries etc. without problems. I use the

[sqlalchemy] Re: DBMS

2008-01-16 Thread Christoph Haas
On Wed, Jan 16, 2008 at 02:33:53PM +0530, Manish Soni wrote: Send me some study material on DBMS. -- Regards, Manish Soni M. Phil.(Computer Science),MCA(Hons.) Master of Science (Computer Science) B.Sc.(Mathematics, Physics, Computer Application) MCPDEA, MCSD(.Net), MCDBA(SQL Server

[sqlalchemy] Re: Connecting to MSSQL with a System DSN on Windows

2008-01-16 Thread Paul Johnston
Hi, 'mssql://DSN=MyDSN'. How can I get this to work without specifying You were nearly there... mssql://?dsn=mydsn Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group,

[sqlalchemy] Re: Doing a dynamic Update

2008-01-16 Thread Mike
Rick, On Jan 15, 1:34 pm, Rick Morrison [EMAIL PROTECTED] wrote: Two issues: a) You need to give SA a table definition for the table you're trying to update. b) You need to specify the name of the column to update in the dict(), not the string 'key' I've updated the script to work by

[sqlalchemy] Re: postgresql truncate table

2008-01-16 Thread Alexandre da Silva
you probably need to begin/commit a transaction since the PG dialect doesnt pick up truncate as an autocommit keyword. exactly, thank you for reply Att -- Alexandre da Silva Analista de Sistemas - Bacharel em Sistemas de Informação (2003-2007)

[sqlalchemy] access the fields in a record as a dict

2008-01-16 Thread alex bodnaru
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi friends, in older sa i could cast a record to a dict, in order to access their fields by their name, especially if the field name is not a valid python identifier, like a calculated or fixed numeric column. how could i do it again please? tia,

[sqlalchemy] Re: Large eager fetches not so eager?

2008-01-16 Thread Rick Morrison
I still have no answer as to what this might be, but I am starting to see it more often. It's now biting me a bit harder as it's beginning to happen on items that I cache on startup and then .expunge(). When I later go to access a relation on the expunged item, the trigger of the lazy loader

[sqlalchemy] Re: DBMS

2008-01-16 Thread Jaimy Azle
On Thursday, January 17, 2008, 2:11:56 AM, Christoph Haas wrote: Send me some study material on DBMS. Pardon me... you have all these degrees but still just order the mailing list of an open-source database toolkit to send you some material on DBMS? We must be having a serious language

[sqlalchemy] Re: access the fields in a record as a dict

2008-01-16 Thread Michael Bayer
what, like dict(row) ? that should workno ? On Jan 16, 2008, at 6:29 PM, alex bodnaru wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi friends, in older sa i could cast a record to a dict, in order to access their fields by their name, especially if the field name is not a

[sqlalchemy] Re: Large eager fetches not so eager?

2008-01-16 Thread Michael Bayer
On Jan 16, 2008, at 7:32 PM, Rick Morrison wrote: I still have no answer as to what this might be, but I am starting to see it more often. It's now biting me a bit harder as it's beginning to happen on items that I cache on startup and then .expunge(). When I later go to access a

[sqlalchemy] Re: Large eager fetches not so eager?

2008-01-16 Thread Rick Morrison
Thanks for the tips. I am sure that none of the objects are loaded beforehand: I've got it localized to a run of unit tests that I can start afresh each time. So far it's intermittent, seems to happen only one of say 10 runs. Happens more frequently on a fresh build of sample data for the test

[sqlalchemy] Re: access the fields in a record as a dict

2008-01-16 Thread alex bodnaru
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi mike, thanks for your prompt answer. it doesn't work anymore, indeed :( alex Michael Bayer wrote: what, like dict(row) ? that should workno ? On Jan 16, 2008, at 6:29 PM, alex bodnaru wrote: hi friends, in older sa i could