Hi all, i've builded a mapper based on over 10 tables and it's
optimized well for use of *_by function.
Obviously some clausoleWhere must be formatted for select so my mapper
has this profile:

class MyClass(DomainObject, SferaDomainObject):
    def search( self, **kw  ):
        by_where_clause = {}
        where_clause = []
        for k,v in kw.items():

            # Generic _by clausole  want use SA engine for dinamic
join_to tbl
            if k in ('filt1', 'filt2', .....):
                by_where_clause[ k ] = v

            # Generic explicit clausole for the where_clause feature
as operators
            elif k == 'filt5':
                where_clause.append( self.c.filt5 >= v)

            elif k == 'filt6':
                where_clause.append( self.c.filt6 <= v )

            else:
                raise ValueError, "XXX"

        if where_clause:
           return
self.select_by( **by_where_clause ).select( and_( *where_clause )
        else:
           return self.select_by( **by_where_clause )


this have extension = SelectResultsExt().


Now...
how can i specify field name in select function ?

something like
select ([tbl1.c.field1, tbl3.c.field2, tbl2.c.field3,
tbl5.c.field1], ??? )


Thank's all
Glauco


--~--~---------~--~----~------------~-------~--~----~
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 more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to