[sqlalchemy] should append_whereclause() return the resulting select?

2007-06-01 Thread Eric Ongerth
The right usage of append_whereclause() seems to be: s = sometable.select() s.append_whereclause(col==val) etc. I just had a kind of tough time recently when I actually assigned the result instead: s = sometable.select() s = s.append_whereclause(col==val) Granted, this was a mistake I

[sqlalchemy] Re: query.instances and select statement

2007-05-30 Thread Eric Ongerth
So far I've been having a great time with generative query-building methods... build a query, filter it, order it, etc... Is there a way to, uh, de-generate a query? E.g., q0 = session.query(someclass) q1 = q.filter(col == value) q2 = q.filter(othercol == othervalue) # all of the above works

[sqlalchemy] Re: query.instances and select statement

2007-05-30 Thread Eric Ongerth
On May 30, 2:06 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 30, 2007, at 4:50 PM, Eric Ongerth wrote: Is there a way to, uh, de-generate a query? E.g., ... As it stands now, this is not actually difficult to do: I just store a set of filters that have been added so far, and when

[sqlalchemy] psycopg install difficulties

2007-05-28 Thread Eric Ongerth
I'm attempting to switch from sqlite to postgresql (i want to make use of postgresql's enforcement of foreign key constraints, among other features) and having a tough time getting anywhere with the psycopg2 adapter. psycopg's website is down and was down the last two times I looked for it over

[sqlalchemy] sqlite and named constraints

2007-05-28 Thread Eric Ongerth
Just to get this into the searchable domain in case anyone else runs into the same errors... sqlalchemy docs indicate that sqlite parses foreign key constraints, but does not enforce them. So far, so good. But it doesn't mention (nor could I find any reference to this in sqlite3's own docs)

[sqlalchemy] Re: psycopg install difficulties

2007-05-28 Thread Eric Ongerth
On May 28, 12:03 am, I wrote: I'm attempting to switch from sqlite to postgresql (i want to make use of postgresql's enforcement of foreign key constraints, among other features) and having a tough time getting anywhere with the psycopg2 adapter. Federico the developer answered my email

[sqlalchemy] Re: sqlite and named constraints

2007-05-28 Thread Eric Ongerth
On May 28, 1:45 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 28, 2007, at 3:28 AM, Eric Ongerth wrote: Obviously a minor concern, and why am I even bothering? Because i'm stuck in sqlite until I can get psycopg2 working in order to migrate to postgresql so I can actually USE

[sqlalchemy] what is the use_alter kwarg for ForeignKeyConstraint?

2007-05-27 Thread Eric Ongerth
I'm curious about the use_alter keyword argument for ForeignKeyConstraint. It's there in the docs but with no explanation, and I've been tracking it through the sources but (forgive me) not quite figuring out exactly what it's doing. --~--~-~--~~~---~--~~ You

[sqlalchemy] Determining class from table

2007-05-24 Thread Eric Ongerth
I'm stumped on what sounds like a simple question, but haven't been able to find an answer yet because the words class, table, and various forms of mapper/mapped/mapping are so common. If I've got a class, a table, and a mapper that connects the two... and then somewhere later on, some function

[sqlalchemy] Re: Determining class from table

2007-05-24 Thread Eric Ongerth
To amplify/clarify, what I was hoping I'd find was something like the following behavior: m = class_mapper(cls) t = m.local_table t.mapper is m True t.mapper.class_ is cls True ...But the table doesn't have that method mapper on it. I suppose that's because a table can be mapped more than

[sqlalchemy] Re: Determining class from table

2007-05-24 Thread Eric Ongerth
On May 24, 9:06 am, Michael Bayer [EMAIL PROTECTED] wrote: On May 24, 2007, at 11:34 AM, Eric Ongerth wrote: I know how to get from a class to a table: m = class_mapper(cls) t = m.local_table But I haven't been able to go in the other direction. theres no registry of tables- mappers

[sqlalchemy] Re: Determining class from table

2007-05-24 Thread Eric Ongerth
On May 24, 10:39 am, Michael Bayer [EMAIL PROTECTED] wrote: ill observe that the requests for how do i find the X object given the Y object correspond to applications that are dealing with tables/classes anonymously, like people building generic GUIs for traversing a data model. That's

[sqlalchemy] Re: remove duplicates - DISTINCT constraint

2007-05-24 Thread Eric Ongerth
On Apr 3, 2:41 am, Disrupt07 [EMAIL PROTECTED] wrote: It would be nice if SQLAlchemy has something to constrain distinct values on save() or flush(). You might be interested in this: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject

[sqlalchemy] Re: Determining class from table

2007-05-24 Thread Eric Ongerth
On May 24, 1:31 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 24, 2007, at 2:11 PM, Eric Ongerth wrote: Is there a shortcut to that longer way around? not at the moment. the tables/columns arent optimized for traversal right now. Thanks -- I can certainly accept that. So then, just

[sqlalchemy] Re: Determining class from table

2007-05-24 Thread Eric Ongerth
On May 24, 3:10 pm, Michael Bayer [EMAIL PROTECTED] wrote: uh well lets look at the source code. Column.unique *is* assigned if you send the unique keyword argument. it transforms the unique keyword argument into a UniqueConstraint when the Column is assigned to its Table via _set_parent.

[sqlalchemy] truncated sentence at the end of associationproxy doc section

2007-05-22 Thread Eric Ongerth
Please note at the bottom of this doc section: http://www.sqlalchemy.org/docs/plugins.html#plugins_associationproxy ... just before the end of the associationproxy section and before the beginning of the orderinglist section, there's a chopped off sentence: The association_proxy function is

[sqlalchemy] Re: truncated sentence at the end of associationproxy doc section

2007-05-22 Thread Eric Ongerth
Cool... thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

[sqlalchemy] Re: winpdb and sqlalchemy

2007-05-14 Thread Eric Ongerth
and now both SPE and winpdb have no trouble finding SQLAlchemy sources for me. Thanks to all respondents. On May 14, 7:31 am, Michael Bayer [EMAIL PROTECTED] wrote: On May 13, 2007, at 11:52 PM, Eric Ongerth wrote: Incidentally, the same problem is happening when using SPE as my editor

[sqlalchemy] Re: winpdb and sqlalchemy

2007-05-13 Thread Eric Ongerth
the egg and get a SVN checkout of SQLAlchemy. Then copy the lib/sqlalchemy directory into your site-packages directory (as sqlalchemy; omit the lib/). This bypasses the egg mechanisms, which /may/ help. Paul Eric Ongerth wrote: I'm using winpdb 1.1.2 to debug my sqlalchemy/wxPython app

<    1   2