[sqlalchemy] Re: column_prefix with synonym

2007-06-28 Thread jdu
Thanks for the quick fixe. Couldn't this read only class property also be set on any mapped attribute so that I can remove the boilerplate Synonym and just use the original mapped attribute as a read only one? A mapper level readonly option (like column_prefix) would be very useful too. On 27

[sqlalchemy] Re: column_prefix with synonym

2007-06-28 Thread svilen
I don't want override. My underlying goal is to make MyDate readOnly. As mapped attributes are already properties, it would be great to be able to 'declare' the readonly behaviour in the mapper. id say this is out of scope for mapper. id favor adding a property argument to

[sqlalchemy] MSSQL Inser problem

2007-06-28 Thread fw
Hi, I have the weirdest of problem. When using mssql, INSERT (via a session flush) in one of my table fail, but there is no error description in the exception (None) The program seems to be alright since when I associate that table (and the Inventory table) with a mysql connection, things work

[sqlalchemy] Re: MSSQL: using pyODBC

2007-06-28 Thread lurcher
Hi, If it helps any, maybe turn on some driver tracing. In the odbc.ini entry set Logging = Yes LogFile = /tmp/sql.log And maybe send it to Easysoft (if you haven't already) As one of the Easysoft developers of that driver, and the PM of unixODBC, I am sure we can sort something out. Or at

[sqlalchemy] Re: MSSQL Inser problem

2007-06-28 Thread Paul Johnston
Hi, I expect this is a known problem with adodbapi/pyodbc in 0.3.8. The workaround is to append ?use_scope_identity=0 to your database URI. Paul On 6/28/07, fw [EMAIL PROTECTED] wrote: Hi, I have the weirdest of problem. When using mssql, INSERT (via a session flush) in one of my table

[sqlalchemy] Re: cascade=all, delete-orphan = FlushError, instance is an unsaved, pending instance and is an orphan

2007-06-28 Thread svilen
On Thursday 28 June 2007 16:16:09 znerol wrote: Hi All Yes, i know, there is a FAQ-entry and i realized that this issue was discussed before. Regretably i'm not able to make things work with a one-to-many relationship using cascade=all, delete-orphan. Now i discovered that even the example

[sqlalchemy] Re: Future of migrate project

2007-06-28 Thread svilen
lets think my real world. i build a (very) complex tree of objects - the model of the application data and relations within. i express this model in some language, implicitly or explicitly, then, automaticaly (or almost-), map this model into set of db tables, constraints etc. and this is

[sqlalchemy] Re: column_prefix with synonym

2007-06-28 Thread Michael Bayer
On Jun 28, 2007, at 4:12 AM, svilen wrote: i have some opinion/wishes around this one too. i have a complete validating/verificating descriptors for all my attributes (plus no other attributes are allowed on my model-related classes - my static_type framework). Those includes

[sqlalchemy] Re: cascade=all, delete-orphan = FlushError, instance is an unsaved, pending instance and is an orphan

2007-06-28 Thread Michael Bayer
On Jun 28, 2007, at 9:16 AM, znerol wrote: Hi All Yes, i know, there is a FAQ-entry and i realized that this issue was discussed before. Regretably i'm not able to make things work with a one-to-many relationship using cascade=all, delete-orphan. Now i discovered that even the example

[sqlalchemy] Re: flush and transactions, doesn't roll back

2007-06-28 Thread mc
Thanks, that was it. On Jun 25, 5:25 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Jun 25, 2007, at 4:09 AM, mc wrote: I have the following piece of code: transaction = session.create_transaction() try: # Do some work here that might fail p=P() p.ID=333 session.save(p)

[sqlalchemy] BETWEEN in where clause?

2007-06-28 Thread voltron
How would would write a query with a BETWEEN? This does not produce what I want resultset = select([links, links.c.lft 3, links.c.lft 10]).execute() I would like all the values lft in table links greater than 3 but less than 10 I am using PostgreSQL Thanks

[sqlalchemy] Re: BETWEEN in where clause?

2007-06-28 Thread voltron
This does not work either :-( resultset = select([links.c.lft.between(links.c.lft 3,links.c.lft 10) ]).execute() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] best practice?

2007-06-28 Thread JeffRo
I'm using sqlalchemy for the first time and want to follow standard or best practices. I have rather fundamental scenario in a turbogears project: - Form post back to exposed method foo - using passed params, foo creates an object thing - thing is saved - redirect is raised to /url/to/thing/%s

[sqlalchemy] Re: cascade=all, delete-orphan = FlushError, instance is an unsaved, pending instance and is an orphan

2007-06-28 Thread lorenz schori
Hi Again I was able to track down the issue. If the addresses attribute is replaced with a newly generated list containing all the items from the old list sqlalchemy apparently thinks that the elements are to be deleted (because the list was replaced) and marks them as orphan. Same

[sqlalchemy] Re: column_prefix with synonym

2007-06-28 Thread sdobrev
On Thursday 28 June 2007 17:50:17 Michael Bayer wrote: On Jun 28, 2007, at 4:12 AM, svilen wrote: i have some opinion/wishes around this one too. i have a complete validating/verificating descriptors for all my attributes (plus no other attributes are allowed on my model-related classes