[Zope] Bug in List/Records ????

Luis Cortes lcortes@pollak.com
Thu, 6 Apr 2000 11:36:06 -0600


I have the following code for a simple International timesheet application:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<dtml-var standard_html_header>


<H1>Timesheet for
<dtml-in "sqlSelectSingleControl()">
        [<dtml-var week_end>]
</dtml-in>

<br>
For  [<dtml-var "AUTHENTICATED_USER">]

</H1>

<form action="dtmlVerifyTimeSheet" method="POST">
<table border=2>

<tr>    <th rowspan="2"> Accounts

<dtml-comment>
================================================================
Place days of week headings
================================================================
</dtml-comment>

<dtml-in "['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']">
        <th colspan="2"> <dtml-var sequence-item>
</dtml-in>

<dtml-comment>
================================================================
place USA or MEX headings
================================================================
</dtml-comment>

<tr>
<dtml-in "1,2,3,4,5,6,7">
        <th>USA<th>MEX
</dtml-in>

<dtml-comment>
================================================================
1.  Place DROP down list of Charge Accounts per row
2.  Place 7 Hour Edit Boxes for usa/mex per row
================================================================
</dtml-comment>


<dtml-let list="DBGetAccts()">

        <dtml-in "1,2,3,4,5,6,7,8,9,10">
        <dtml-let rowid=sequence-item>

                <dtml-comment>
                ================================================================                Charge Accounts per row
                ================================================================                </dtml-comment>


                <tr><td>
                <SELECT NAME="items.acct:records">
                <dtml-in list>
                        <OPTION SELECTED VALUE="<dtml-var aid>">
                                (<dtml-var aid>) <dtml-var description>
                        </OPTION>
                </dtml-in>
                </SELECT>

                <dtml-comment>
                ================================================================
                mex/usa hours per row
                ================================================================                </dtml-comment>


                <dtml-in "1,2,3,4,5,6,7">
                        <td> <input type="float" name="items.usa:records" maxlength = "4" size="4">
                        <td> <input type="float" name="items.mex:records" maxlength = "4" size="4">
                </dtml-in>
        </dtml-let>
        </dtml-in>
</dtml-let>


<dtml-comment>
================================================================
place OK button
================================================================
</dtml-comment>

</table>
<input type = "submit" value="OK">
</form>

<p>
Today is <dtml-var ZopeTime fmt=Date>, the time is <dtml-var ZopeTime fmt=Time>.</P>

<dtml-var standard_html_footer>


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Please notice that I have an adjustable number of charge accounts.  What is
nice is that I get an ordered list from my records which looks like:

[acct: 1, mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: ,
mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: ,
usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: ,
usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: ,
mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: ,
usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: ,
usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , acct: 1, mex: , usa: , mex: , usa: , mex: , usa: ,
mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: , mex: , usa: ] 


The problem, if you will carefully notice, is that from acct:1 to the next
acct:1 there are only 6 pairs of mex:, usa:, in the rest there are 7 and in the
last acct:1 to end of list there are 8!  Is this behavior correct???  I really
doubt it, but if it is correct can someone explain it to me???

regards,
Luis.





-- 
======================================================

Luis Cortes

Pollak EPD (915) 621-6113

======================================================