[issue2551331] Fix repeat first/last methods.

John Rouillard <[email protected]> Mon, 08 Apr 2024 00:06:51 +0000
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from John Rouillard:

When using this:

   <span>
     <tal:x tal:repeat="field
          python:request.form['@columns'].value.split(',')">
       <tal:x tal:replace="field"></tal:x>
       <tal:x tal:condition="repeat/field/first"
              tal:content="repeat/field/Letter"></tal:x>
       <tal:x tal:condition="repeat/field/last"
              tal:content="repeat/field/letter"></tal:x>
     </tal:x>
   </span>

with an index page, you used to see:

   title A a id B b status C c creator D d assignedto E e activity F f

I expected:

  title A id status creator assignedto activity f

first() and last() call same_part(). I have no idea what same_part is supposed
to do. In some circumstances it will make last()/first() return True even though
there are more items in the iterator.

However I can fix the original TAL to produce what I expect by having first/last return:

  return self.same_part(name, ...)

rather than:

  return not self.same_part(name, ...)

----------
assignee: rouilj
components: Web interface
messages: 7981
nosy: rouilj
severity: normal
status: new
title: Fix repeat first/last methods.
type: behavior

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551331>
_________________________________________________