[sqlalchemy] Interpretation of SAWarning: No ForeignKey objects were present in secondary table 'post_keywords'...

2011-04-19 Thread Kent
I'm getting an SAWarning (0.6.4 and also 0.7b5dev) which has a message that confuses me, so I've duplicated the problem with a script: === from sqlalchemy import * from sqlalchemy.orm import * engine = create_engine('sqlite:///', echo=True) metadata

[sqlalchemy] API that allows me to do additional database operations just before insert execution for SQL Expression

2011-04-19 Thread bool
Is there any API that allows me do some processing (I want to do additional updates based on the insert statement) just before executing an insert statement using SQL Expression? I dont want to do this during compile time (@Compiles(Insert)) as I will be doing some database updates and this is

RE: [sqlalchemy] API that allows me to do additional database operations just before insert execution for SQL Expression

2011-04-19 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of bool Sent: 19 April 2011 14:16 To: sqlalchemy Subject: [sqlalchemy] API that allows me to do additional database operations just before insert execution for SQL Expression Is

Re: [sqlalchemy] Support for tuple expressions?

2011-04-19 Thread Michael Bayer
there's a tuple_() operator: http://www.sqlalchemy.org/docs/core/expression_api.html?highlight=tuple_#sqlalchemy.sql.expression.tuple_ the object returns is _Tuple. if you wanted fancy per-dialect expression behavior, mmm tricky, you'd need to subclass _Tuple (or write a new object),

Re: [sqlalchemy] Interpretation of SAWarning: No ForeignKey objects were present in secondary table 'post_keywords'...

2011-04-19 Thread Michael Bayer
On Apr 19, 2011, at 9:04 AM, Kent wrote: I'm getting an SAWarning (0.6.4 and also 0.7b5dev) which has a message that confuses me, so I've duplicated the problem with a script: === mapper(PostSpotLight, spotlights_table, properties =

Re: [sqlalchemy] Interpretation of SAWarning: No ForeignKey objects were present in secondary table 'post_keywords'...

2011-04-19 Thread Kent Bower
So, what would you suggest the right answer is in this case? In the real world scenario we have a potentially good reason to avoid the association proxy approach since that involves an additional table which may be unneeded. Is the best answer just to provide the foreign keys as I did? On

Re: [sqlalchemy] Interpretation of SAWarning: No ForeignKey objects were present in secondary table 'post_keywords'...

2011-04-19 Thread Michael Bayer
On Apr 19, 2011, at 12:57 PM, Kent Bower wrote: So, what would you suggest the right answer is in this case? In the real world scenario we have a potentially good reason to avoid the association proxy approach since that involves an additional table which may be unneeded. Is the best

[sqlalchemy] Oracle column names beginning with a digit

2011-04-19 Thread Sirko Schroeder
Hi, I have a little problem with column names that start with a digit at an oracle databases which I inherited. When I try to do and update/insert with values from a dict like this i.e.: ---8-- engine =create_engine('oracle+cx_oracle://foobar') engine.echo = True Session =

Re: [sqlalchemy] Oracle column names beginning with a digit

2011-04-19 Thread Michael Bayer
On Apr 19, 2011, at 9:55 PM, Sirko Schroeder wrote: Hi, I have a little problem with column names that start with a digit at an oracle databases which I inherited. When I try to do and update/insert with values from a dict like this i.e.: site_tbl = Table('TBL_SITE', metadata, autoload =

[sqlalchemy] Re: Error with Adjacency List Relationship Implementation

2011-04-19 Thread Aviv Giladi
Figured it out, I was being retarded. Thanks! On Apr 19, 7:33 pm, Aviv Giladi avivgil...@gmail.com wrote: Hey guys, I am playing around with SQLAlchemy (over Pylons) and encountering a strange problem. I am using the adjacency list relationship concept to represent nodes and their parents in

[sqlalchemy] Self-referencing Table Cannot Have 0 as Primary Index?

2011-04-19 Thread Aviv Giladi
Hey guys, I encountered a very strange problem with SQLAlchemy. I have a model that is self-referencing (adjacency list relationship). I simply copied the model (Node) from the SQLAlchemy tutorial. Here is the model's code: class Node(Base): __tablename__ = 'nodes' id =

[sqlalchemy] Re: Support for tuple expressions?

2011-04-19 Thread bukzor
Thanks Michael. I won't be using or supporting SQL Server, so I'm quite fine with that. I guess the way forward would be to install SA in develop mode and make the changes directly? Excuse my ignorance, but why would you do it that way? Since I don't want to change any of the functionality of