Roundup Tracker - Issues

Issue 2551331

classification
Fix repeat first/last methods.
Type: behavior Severity: normal
Components: Web interface Versions:
process
Status: fixed fixed
:
: rouilj : rouilj
Priority: :

Created on 2024-04-08 00:06 by rouilj, last changed 2024-04-08 01:00 by rouilj.

Messages
msg7981 Author: [hidden] (rouilj) Date: 2024-04-08 00:06
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, ...)
msg7982 Author: [hidden] (rouilj) Date: 2024-04-08 01:00
changeset:   7866:9bbc1d951677

contains the fix. Updated doc on it part of the cleanup in changeset:   7867:1774fdf2010a.
History
Date User Action Args
2024-04-08 01:00:29rouiljsetstatus: new -> fixed
resolution: fixed
messages: + msg7982
2024-04-08 00:06:51rouiljcreate