At 10:08 AM 10/5/2001 -0400, Aaron Held wrote:
>callLogQuery.addWhereClause( callLogTable.State, "NJ", QueryBuilder.EQUALS)
>callLogQuery.addWhereClause( "extention", "1111", QueryBuilder.EQUALS)
>callLogQuery.addWhereClause( "duration", "60", QueryBuilder.GREATER_THAN)
>
>I'm actually trying to figure out the best way to handle this type of 
>query builder in webware/python today.  I'm building a
>reporting engine and I want a clean set of classes to handle the query.

Here is how you do server side queries in MiddleKit:

store.fetchObjectsOfClass('CallLog', clauses='where state="NJ" and 
extension="1111" and duration="60"')

I think the clauses= approach is a lot easier to read and write than the 
multiple calls to create WHERE clauses. The potential downside is that this 
is direct SQL code, however this kind of simple SQL code is highly portable.

Note that the above call will also pick up subclasses of CallLog if there 
are any. If for some reason you didn't want that, you could add isDeep=1 to 
the call.


-Chuck


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to