Issue 1221936
Created on 2005-06-16 14:04 by micktwomey, last changed 2005-06-24 05:41 by richard.
msg1976 |
Author: [hidden] (micktwomey) |
Date: 2005-06-16 14:04 |
|
I've encountered a slightly annoying situation when I
wanted to use the following:
<td tal:content="structure
python:context.product.menu(sort_on='title')"></td>
Where product is a normal Class.
There are two problems with the above:
1. The docstring for
roundup.cgi.templating.LinkHTMLProperty.menu is
inaccurate. The sort_on is just a plain property
string, it'll use a '+' sort no matter what you do,
whereas the docstring says you can use ('+',
'attribute'). So I couldn't do a descending sort.
2. If there is an order attribute present, it ignores
your specified sort and sorts on order. This was a
problem with my product class as it had a left over
order attribute from a previous life. Regardless, there
might be cases where you don't want to sort by order.
|
msg1977 |
Author: [hidden] (richard) |
Date: 2005-06-24 05:41 |
|
Logged In: YES
user_id=6405
Fixed it, and added some extra flavour. You may now specify
"+attribute" as well, instead of resorting to the awful tuple
syntax.
|
|
Date |
User |
Action |
Args |
2005-06-16 14:04:33 | micktwomey | create | |
|