[sqlalchemy] Conflicting columns with secondaryjoin

2007-03-16 Thread Mel Collins
In my project, I have users, who receive messages, which can be assigned any number of 'tags'. (In the same manner as Gmail's labels) I've got (amongst others) the following tables: - UserMessages (userId, messageId, ...) - UserMessageTags (userId, messageId, tagId) - UserTags (userId, tagId,

[sqlalchemy] Re: pyodbc and tables with triggers

2007-03-16 Thread Tim Golden
Rick Morrison wrote: Sorry, Stephen, I replied too early; your second email arrived before the first. A whole day before the first. So until we get a real cleanup, you're looking to try modules in this order: ['pyodbc', 'adodbapi', 'pymssql'] Sounds OK to me -- any objections out

[sqlalchemy] Re: MS-SQL 2005: unicode inserts fail?

2007-03-16 Thread Paul Johnston
Hi, This could be a problem with reflection (autoload'ing the table). Try defining the table explicitly. Paul metaperl wrote: The following simple program dies (stack trace follows). It is in fact because of unicode character strings, because the same program works if you remove the u from

[sqlalchemy] Inconsistent results in session.flush()

2007-03-16 Thread King Simon-NFHD78
Hi, I'm having a problem where the results of session.flush() vary from one run to another of my test suite. The unit of work transaction dump is significantly different from one run to the next, similar to the issue in ticket 461. I haven't managed to make a test case small enough to post to

[sqlalchemy] use_labels =30 vs MAX_LABEL_LENGTH

2007-03-16 Thread Jose Soares
Hi Michael, I see that sql.py uses a limit of 30 characters to create the column label when use_labels is set to True. If name is greater than 30 char long, the label is trunked at position 24 and is appended a random integer to it. Since the name created in this way is less useful, I would

[sqlalchemy] Re: error compile

2007-03-16 Thread Jose Soares
Sébastien LELONG ha scritto: Seems that SA compiles in a wrong way my query... Can't what's wrong is happening... subvet appers to be a sub-select, so probably SA made some optimizations. You should print the whole query (print sql) and not the sub-query (as in your code: print

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-16 Thread Michael Bayer
On Mar 16, 2007, at 6:59 AM, King Simon-NFHD78 wrote: Unfortunately I don't know how to go about debugging this. I think I need to see exactly what is going on in the dependency sort. Do you have any suggestions for suitable places to add some extra logging? these issues are often due

[sqlalchemy] Re: error compile

2007-03-16 Thread Michael Bayer
put correlate=False in your subquery. On Mar 16, 2007, at 12:43 PM, Jose Soares wrote: Hi, Seems that SA compiles in a wrong way my query... In [9]: sql=select([UnitaAziendale.c.id]) In [10]: subvet = select([azienda_veterinario.c.id_unita_aziendale], :

[sqlalchemy] Re: error compile

2007-03-16 Thread Jose Soares
Sébastien LELONG ha scritto: As you can see the from_obj of subselect is wrong, the FROM should be: FROM azienda_veterinario, unita_aziendale OK, I see... You probably mean that since your sub-select occurs on two tables, those have to be present in the FROM clause. I've tested this

[sqlalchemy] Re: pyodbc and tables with triggers

2007-03-16 Thread Rick Morrison
I don't think you missed anything; that more sophisticated approach is exactly what we're discussing. Seeing as how you have all three modules installed and switch between them, you probably have your own ideas about how it should work. Please pick up the discussion on ticket #480 and give us your

[sqlalchemy] Re: Conflicting columns with secondaryjoin

2007-03-16 Thread Michael Bayer
the error youre getting typically occurs when theres more than one instance of a userMessageTags.c.userId Column instance. how there might be more than one of the same Column instance can sometimes happen when using table reflection and things get confused...although I was pretty sure I

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-16 Thread Michael Bayer
I can actually read a fair degree from these dumps, i need mostly to know what the actual dependencies are (i.e. which classes are dependent on what, whats the error). also when you do the full debug echoing the UOW should illustrate a series of dependency tuples which will show what

[sqlalchemy] Re: cascading question

2007-03-16 Thread Alexandre CONRAD
Humm, this doesn't help as if a site is deleted, it deletes the options that where related to that option. I want to be able to: - delete an option without deleting a site - delete a site without deleting an option just delete (clean up) the related rows inside the weak options_has_sites

[sqlalchemy] Re: cascading question

2007-03-16 Thread Michael Bayer
the rows in the M2M table should be deleted automatically.it *might* require that your instances are present in the session but its not supposed to. can you make me a short test case for this one ? its not the first time ive heard about it. technically you can just put ON DELETE

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread Michael Bayer
all tests pass on Mac OSX with the latest sqlite (as well as postgres, mysql). solaris, not so sure, ill have a look later. On Mar 16, 2007, at 1:19 PM, [EMAIL PROTECTED] wrote: Michael OK this was something small, the alltests.py scripts needed Michael to call testbase's

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread Michael Bayer
I just ran my python 2.5 install (its a framework install) on OSX against the test suite on r2418, which uses the built-in sqlite3, and i got all tests passed. On Mar 16, 2007, at 1:19 PM, [EMAIL PROTECTED] wrote: Michael OK this was something small, the alltests.py scripts needed

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread Michael Bayer
geez, what version of sqlite / pysqlite / python is running there ? tons of those errors ive never seen before. On Mar 16, 2007, at 1:19 PM, [EMAIL PROTECTED] wrote: Michael OK this was something small, the alltests.py scripts needed Michael to call testbase's main() function

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread Michael Bayer
ah, in fact one failure youre having, the testcast failure, is indicative of running against a very old sqlite. FAIL: testcast (sql.select.SelectTest) -- Traceback (most recent call last): File

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread skip . montanaro
Michael all tests pass on Mac OSX with the latest sqlite (as well as Michael postgres, mysql). Hmmm... Then I wonder what's different about the buildbot setup and a normal interactive run. Michael solaris, not so sure, ill have a look later. There's no particular need. I was

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread skip . montanaro
Michael geez, what version of sqlite / pysqlite / python is running Michael there ? tons of those errors ive never seen before. That will have to wait for me to get home. Probably not until tomorrow at the earliest. I'll let you know what I figure out. Perhaps I can tweak the

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-16 Thread King Simon-NFHD78
I've just run the attached script about thirty times, and it succeeded 5 times and failed the rest. I've cut out a lot of unnecessary stuff, but it's still a bit long I'm afraid. I'll cut it down some more, but since you seemed so eager to see it ;-) I thought I'd send it along as is. On a bad

[sqlalchemy] Use pyPgSQL module with SA?

2007-03-16 Thread lwkinca
Hi- My apologies if this has been asked and answered, but I was unable to find any reference. The SA documentation says it's possible to pyPgSQL instead of psycopg2 but I can't make it work. Basically, here's what I'm trying: from sqlalchemy import * from pyPgSQL import libpq def myConn():

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread skip . montanaro
Michael ah, in fact one failure youre having, the testcast failure, Michael is indicative of running against a very old sqlite. Can you tell me what version I'm using other than very old? Here's what I see: $ otool -L lib-dynload/_sqlite3.so lib-dynload/_sqlite3.so:

[sqlalchemy] Re: SQLAlchemy test suite - no success/failure exit code

2007-03-16 Thread Michael Bayer
go into python and type: from pysqlite2 import dbapi2 dbapi2.sqlite_version On Mar 16, 2007, at 3:23 PM, [EMAIL PROTECTED] wrote: Michael ah, in fact one failure youre having, the testcast failure, Michael is indicative of running against a very old sqlite. Can you tell me

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-16 Thread Michael Bayer
oh, this is easy. you have a circular insert relationship between label and release_line, which you can see in the sort there (the cycles:) as well as evidenced by the fact that you have a use_alter needed in order to create the foreign keys on those two tables. add post_update=True to