TALES repeat/variable/letter skips aa-az values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.tal |
Invalid
|
Low
|
Unassigned |
Bug Description
The specification for TALES repeat variables Products/
*letter* - repetition number as a lower-case letter: "a" -
"z", "aa" - "az", "ba" - "bz", ..., "za" - "zz", "aaa" - "aaz",
and so forth.
It seems like the "aa" - "az" part is skipped. It is the same for the uppercase Letter feature.
Some simple test code:
<ul>
<li tal:repeat="number python:xrange(100)" tal:content=
</ul>
<ul>
<li tal:repeat="number python:xrange(100)" tal:content=
</ul>
repeat/number seems to be an iterator whose baseclass is ZTUtils.
def letter(self, base=ord('a'), radix=26):
index = self.index
s = ''
while 1:
index, off = divmod(index, radix)
s = chr(base + off) + s
if not index: return s
def Letter(self):
return self.letter(
Not sure if it is supposed to be this way, but AFAICS it is not the way it is documented and it is not the way that coloumns are numbered in spreadsheet applications like Excel.
affects: | zope2 → zope.tal |
The zope.tal project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope. tal.