[Zope-dev] Bug in dtml-in ????

Andre Schubert andre.schubert@geyer.kabeljournal.de
Wed, 02 May 2001 16:55:13 +0200


Hi,

i have found a solution in DT_In.py
change this( beginning at line 537 ):

                    else:
                        kw['previous-sequence']=0
                        if index==last:
                            try:
                                # The following line is a sneaky way to
                                # test whether there are more items,
                                # without actually computing a length:
                                sequence[end]
                                pstart,pend,psize=opt(end+1-overlap,0,
                                                      sz,orphan,sequence)
                                kw['previous-sequence']=0
                                kw['next-sequence']=1
                                kw['next-sequence-start-index']=pstart-1
                                kw['next-sequence-end-index']=pend-1
                                kw['next-sequence-size']=pend+1-pstart
                            except: pass

to this:

                    if index==last:
                        try:
                            # The following line is a sneaky way to
                            # test whether there are more items,
                            # without actually computing a length:
                            sequence[end]
                            pstart,pend,psize=opt(end+1-overlap,0,
                                                      sz,orphan,sequence)
                            kw['next-sequence']=1
                            kw['next-sequence-start-index']=pstart-1
                            kw['next-sequence-end-index']=pend-1
                            kw['next-sequence-size']=pend+1-pstart
                        except: pass

and everything works well with size=1

as


Andre Schubert schrieb:

> Hi,
>
> I have found a error/bug in the dtml-in tag.
> I have an SQL-Query that returns traffic-data grouped by month and year.
>
> Th SQL-query returns 5 rows of data.
> I want a page to show only one month.
> If i use:
> <dtml-in foo size=1 orphan=1 start=query_start>
> <dtml-if sequence-start>
> <dtml-if next-sequence>
> .....
> </dtml-if>
> </dtml-if>
>
> I got the following result.
> The next-statement returns the url to the next row of data( the second
> row ).
> The context is the current row of data ( first row ).
> If i click on the link to the next row( query_start=2 ) i got the the
> second row of data, but i don't got a link to the third row of data, i
> only got a link back to the first.
> If i set size=2 everything works fine.
> But when size=1 the the error occurs, i can only switch between the
> first to rows of data.
> I have testet it with different SQL-query's on Zope-2.2.5 on
> Redhat-Immunix-6.2
>
> Please help
>
> Thanks as
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )