I noticed that method in middlekit, but I am building a query that can have a number 
of completely different WHERE clauses.  Calling
one method per clause is easier to understand in my situation.

I have a simple loop for each parameter
Validate input ->determine field and data type (date, string, integer) -> call 
addWhereClause

Doing is as one SQL statement means I still have to build the logic somewhere to 
create a legal where clause. I was thinking about a
little utility class that would let me generate this clause.

like ->
cBuilder.db=(cBuilder.PostGres)
cBuilder.addWhere("date","10/01/01",cBuilder.Greater_Than)
cBuilder.addOrderBy("date",cBuilder.DESC)

 store.fetchObjectsOfClass('CallLog', clauses=cBuilder.clause)

For now though I just need a way to pull a resultset and make an html table or excel 
sheet based on it.  Since I don't need caching
or updating are there any other advantages to MiddleKit that I am missing.  Instead of 
MiddleKit I was thinking about using dtuple
with a regular DB call.

MiddleKit is great for the user admin though.

Thanks,
-Aaron
http://www.lyra.org/greg/python/dtuple.py
----- Original Message -----
From: "Chuck Esterbrook" <[EMAIL PROTECTED]>
To: "Aaron Held" <[EMAIL PROTECTED]>; "tom smith" <[EMAIL PROTECTED]>; 
<[EMAIL PROTECTED]>
Sent: Friday, October 05, 2001 10:41 AM
Subject: Re: [Webware-discuss] MiddleKit Problems


> 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



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

Reply via email to