[ZCM] [ZC] 2260/ 2 Comment "Examples/FileLibrary sort feature broken"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2260 Update (Comment) "Examples/FileLibrary sort feature broken"
Status Pending, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/2260
==============================================================
= Comment - Entry #2 by yolabingo on Jan 8, 2007 12:52 pm
Of course, after drinking coffee I realized that simply changing
else:
new_reverse=not reverse
to
else:
new_reverse=int(not reverse)
would be much nicer and preserve the logic. But the logic does not appear to be necessary, so
else:
new_reverse=1
should suffice.
________________________________________
= Request - Entry #1 by yolabingo on Jan 8, 2007 12:39 pm
While playing with the example file library, I found that it would not reverse-sort:
"You can click on the column names to sort the files. If you click twice on a column
then the files are sorted in reverse order."
Clicking twice on a column produced the following error:
> An error was encountered while publishing this resource.
> Error Type: ValueError
> Error Value: An integer was expected in the value 'True'
The following ugly modification to Examples/FileLibrary/getLink fixes the problem:
> """
> Returns a URL which gives sorting commands in the query string.
> """
> url=context.REQUEST.URL0
> if new_sort != sort:
> new_reverse=0
> else:
> new_reverse=not reverse
>+ if new_reverse:
>+ new_reverse = 1
>+ else:
>+ new_reverse = 0
>return "%s?sort=%s&reverse:int=%s" % (url, new_sort, new_reverse)
==============================================================