Jorge Godoy schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >> No deal. Just do stuff like this (for example of course): >> >> whereClauses = [] >> >> if condition: >> whereClauses.append(Model.q.someProp == someValue) >> if other_condition: >> whereClauses.append(Model.q.someOtherProp == someOtherValue) >> >> if whereClauses: >> return Model.select(AND(*whereClauses)) >> else: >> return Model.select() > > Using the filter method looks a lot cleaner to me... And easier to see what > is happening. >
To be honest: I wasn't aware of it. But then, more complicated queries might need OR'ed expressions and joins for sorting. So - I guess it depends. Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

