Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-22 Thread Harry Percival
, thanks for all your help. Harry On Tue, Jul 20, 2010 at 5:14 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 11:51 AM, Harry Percival wrote: attached. feel free to ignore the 'sqlite' folder, which is only needed for ironpython. the error definitely occurs in cpython 2.6.3

Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-20 Thread Harry Percival
Bayer mike...@zzzcomputing.com wrote: On Jul 19, 2010, at 12:04 PM, Harry Percival wrote: Michael, thanks, as ever, for your help. So, I think I've managed to specify the relationships: j = join(movies_table,md_table).join(directors_table).join(genres_table) js = j.select(use_labels=True

Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-19 Thread Harry Percival
: On Jul 19, 2010, at 10:24 AM, Harry Percival wrote: OK, so I will treat any classes mapped to a join of multiple tables as being a read-only API, and manually manage the write-API using relationship(). It doesn't look like I can define a relationship from the composite mapped class to individual

[sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-15 Thread Harry Percival
A new problem, which seems to occur in both IronPython and normal Python: I have a database with tables for movies, directors, genres (and a bridging table movie_directors) I have a class mapped to a join of all three of the above j =

Re: [sqlalchemy] problem with multi-table mapping - how to configure merge/cascade behaviour on mappers based on join/select?

2010-07-15 Thread Harry Percival
15, 2010, at 2:52 PM, Harry Percival wrote: A new problem, which seems to occur in both IronPython and normal Python: I have a database with tables for movies, directors, genres (and a bridging table movie_directors) I have a class mapped to a join of all three of the above j = join

Re: [sqlalchemy] problems with multi-table mapping on IronPython

2010-07-11 Thread Harry Percival
be the cause of a few errors... might take a look at On Sat, Jul 10, 2010 at 6:11 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jul 10, 2010, at 12:07 PM, Harry Percival wrote: OK, just in case anyone else is foolishly trying to run SQLA on ironpython, here's the workaround I've

Re: [sqlalchemy] problems with multi-table mapping on IronPython

2010-07-10 Thread Harry Percival
command to run to launch tests. rgds, harry On Tue, Jul 6, 2010 at 6:40 PM, Harry Percival harry.perci...@gmail.comwrote: Hi Michael, thanks for replying - the reason I attached a zipfile is because sqlite isn't supported natively on ironpython, so I've had to include the source

Re: [sqlalchemy] problems with multi-table mapping on IronPython

2010-07-08 Thread Harry Percival
except Exception, e: print 'caught exception',e last_error = e traceback.print_exc() how can i run the sqlalchemy test suite? I see it needs nose, i've installed that. but i'm not clear what command to run to launch tests. rgds, harry On Tue, Jul 6, 2010 at 6:40 PM, Harry Percival

Re: [sqlalchemy] mappers and non_primary arg

2010-07-06 Thread Harry Percival
Hey, a workaround i've used is is to manually set primary key to being a composite of all columns if the table has no actual primary key. however, this will mean that sqlalch ignores any duplicate rows, which you may not want. hp. On Thu, Jul 1, 2010 at 7:41 PM, sandro dentella san...@e-den.it

Re: [sqlalchemy] problems with multi-table mapping on IronPython

2010-07-06 Thread Harry Percival
the sqla unit tests? On Tue, Jul 6, 2010 at 3:56 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jul 6, 2010, at 4:18 AM, Harry Percival wrote: Hi, I've got an error which occurs in ironpython but not in cpython. can anyone replicate? See attached. I'm using IPY 2.6. *string:1

Re: [sqlalchemy] sqlite transaction rollback after pk clash not working?

2010-06-18 Thread Harry Percival
, at 6:21 AM, Harry Percival wrote: `Hey all, I have some code that attempts to add a bunch of new entries to a table in a single commit, with some try/excepts designed to catch any primary key errors. if any errors occur, i want to be able to manually go through and re-attempt each line one

[sqlalchemy] sqlite transaction rollback after pk clash not working?

2010-06-17 Thread Harry Percival
Hey all, I have some code that attempts to add a bunch of new entries to a table in a single commit, with some try/excepts designed to catch any primary key errors. if any errors occur, i want to be able to manually go through and re-attempt each line one by one to understand which ones fail and

[sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Harry Percival
Not sure what the etiquette is re cross-posting to this list from stackoverflow? here's my question: http://stackoverflow.com/questions/3044518/how-do-i-take-advantage-of-sqlite-manifest-typing-type-affinity-using-sqlalchem I like the idea of sqlite's manifest typing / type affinity:

Re: [sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Harry Percival
if that was a little arrogant? On Tue, Jun 15, 2010 at 4:22 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jun 15, 2010, at 7:14 AM, Harry Percival wrote: Not sure what the etiquette is re cross-posting to this list from stackoverflow? here's my question: http://stackoverflow.com

Re: [sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Harry Percival
Thanks Michael - i've seen others complain about the arbitrary-precision numbers issue... I'm not so bothered by that, but i do like the ability to natively store integers and strings in the same column. On Tue, Jun 15, 2010 at 4:40 PM, Harry Percival harry.perci...@gmail.comwrote: Answered my

[sqlalchemy] reflecting existing databases with no a priori knowledge of their structure

2010-06-03 Thread Harry Percival
Hi All, I'm building a tool to extract info from databases.  The user/programmer doesn't have any advance knowledge of the structure of the database before they load it, and i want to dynamically generate mapped classes for the database. i just want to check there isn't some helpful sqlalchemy

[sqlalchemy] testing?

2010-04-20 Thread Harry Percival
how do I run some self-testing in sqlalchemy? I found this doc, but it seems to be out of date?? http://svn.sqlalchemy.org/sqlalchemy/trunk/README.unittests just for fun, i'm trying to run these tests inside IronPython, so any pointers in that direction would be helpful also.. thx, HP -- You