I'd like to be able to define a query in the same way that I can define a table. This would give me a consistent interface to all relations, whether views, tables or queries.
I'd like to be able to define my queries somthing like this: class AllTables(SimpleQuery): __query__ = '''select schema_name, table_name from something order by schema_name, table_name''' And then be able to things like: . . . data=DBSession.query(AllTables).all() . . . just as I can with Table objects. I've been playing around with subclassing Table but session.Query does not want to play nice with me. The only idea I have right now is to define a new Query object which can figure out if its been called for a SimpleQuery and take appropriate action. That seems really sucky though. Anyone have any better ideas? Better yet, has anyone done this? __ Marc
signature.asc
Description: This is a digitally signed message part