[Zope] Zope with Microsoft Access

Chris Gray cpgray@library.uwaterloo.ca
Wed, 22 Nov 2000 20:37:36 -0500 (EST)


Isn't the problem your else tags?  Remove them and I think you'll get the
effect you wanted.  As it stands the condition:

<dtml-if "_['sequence-key'][6:9] == mykey[9:12]">

is never true.

Chris

On Wed, 22 Nov 2000, Mike Kelland wrote:

> Hi, this is my first posting to the list, and about my 4th day working with
> Zope.  I have a bit of a problem.  All my code so far is working well.  Just
> the following section is defying my attempts to make it run.  What it does
> is to update a field in the database (to allow employees to quickly update
> their hours in the hours tracking thing I'm creating)  it's complex since
> all the employees hours will be listed on one page and will be instantly
> updatable (with a select box that allows the choice of +/- (name is
> modify<dtml-var hoursID> and value is either + <hours already input> or -
> <hours already input>) and a text field for entering hours to add or
> subtract (name is mod_hours<dtml-var hoursID>)).
> 
> The code (in the DTML document) is:
> 
> <dtml-in "REQUEST.form.items()">
> <dtml-if "_.string.find(_['sequence-key'], 'mod_hours')">
> <dtml-else>
> <dtml-let mykey=sequence-key myval=sequence-item>
> <dtml-in "REQUEST.form.items()">
> <dtml-if "_.string.find(_['sequence-key'], 'modify')">
> <dtml-else>
> <dtml-if "_['sequence-key'][6:9] == mykey[9:12]">
> <dtml-if myval>
> <dtml-call UpdateHours(REQUEST)>
> </dtml-if>
> </dtml-if>
> 
> </dtml-if>
> </dtml-in>
> 
> </dtml-let>
> </dtml-if>
> </dtml-in>
> 
> and the SQL method UpdateHours is:
> 
> update emp_hours set hours =
> <dtml-var expr="_['sequence-item']">
> <dtml-var expr="_['myval']">
> where
> hoursID = <dtml-var expr="_['mykey'][9:12]">;
> 
> with arguments: sequence-item, myval, mykey
> 
> I've tried everything I can think of but it not only refuses to do anything,
> it also refuses to raise an error.
> 
> If anyone can help out I'd be very grateful.
> 
> Thanks
> Mike Kelland
> mike@studiomatic.com
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>