[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-09 Thread Ross Vandegrift
On Fri, Aug 07, 2009 at 09:39:33AM -0700, allen.fowler wrote: As an aside, I wonder if it is possible to just subclass my Records object so that the CurrentRecords class adds/enforces certain filter_by parameters for any query against it. Yes - SA's ORM can map to arbitrary Selectable object.

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-09 Thread allen.fowler
On Aug 7, 11:45 am, Michael Bayer mike...@zzzcomputing.com wrote: AF wrote: Hello, I have a table of records in the database that I want to run read queries against, but I do want to include all of them in the search. (There are a couple of filtering parameters to exclude records

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-09 Thread Michael Bayer
On Aug 9, 2009, at 1:24 PM, allen.fowler wrote: So, just to clarify: At this point in time, can SQLAlchemy be used to define and query simple VIEWs in a database agnostic manner? And if not, is this a feature that is slated for addition any time soon? CREATE VIEW is almost identical

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-09 Thread allen.fowler
On Aug 9, 1:42 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 9, 2009, at 1:24 PM, allen.fowler wrote: So, just to clarify: At this point in time, can SQLAlchemy be used to define and query simple VIEWs in a database agnostic manner? And if not, is this a feature that is

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-09 Thread Michael Bayer
On Aug 9, 2009, at 5:36 PM, allen.fowler wrote: Still, though, it looses the auto generation capability via drop_all()/ create_all() vs. traditional tables and feels out-of-place along side the rest of SQLAlchemy's slickness. I still have the job of documenting 0.6's features, but even

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-07 Thread Michael Bayer
AF wrote: Hello, I have a table of records in the database that I want to run read queries against, but I do want to include all of them in the search. (There are a couple of filtering parameters to exclude records from the searched pool, including an aptly named is_active flag.)

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-07 Thread allen.fowler
On Aug 7, 11:45 am, Michael Bayer mike...@zzzcomputing.com wrote: AF wrote: Hello, I have a table of records in the database that I want to run read queries against, but I do want to include all of them in the search. (There are a couple of filtering parameters to exclude records

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-07 Thread werner
Allen, allen.fowler wrote: ... To clarify: I am using SQLAlchemy's Declarative Base to fully define and create my database. For instance, there is a simple class/table Records, and I would like to define a class CurrentRecords that is implemented in the database as a view on Records.

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-07 Thread allen.fowler
... To clarify: I am using SQLAlchemy's Declarative Base to fully define and create my database. For instance, there is a simple class/table Records, and I would like to define a class CurrentRecords that is implemented in the database as a view on Records. In this way, I can

[sqlalchemy] Re: VIEW alternative in SQLAlchemy

2009-08-07 Thread werner
allen.fowler wrote: ... To clarify: I am using SQLAlchemy's Declarative Base to fully define and create my database. For instance, there is a simple class/table Records, and I would like to define a class CurrentRecords that is implemented in the database as a view on