def index():
rows=db().select(db.article.ALL, orderby=~db.article.submitted|~db.
article.views, limitby=(0,5))
return dict(Articles=rows)
Thats my code from the default.py
removing and adding the second ~ doesn't change anything.
in my index.htm I simply print the Titles and views with a for loop.
On Sunday, May 13, 2012 3:03:30 PM UTC+2, Anthony wrote:
>
> orderedby=~db.article.date|~db.article.views
>
> should work. Did you try exactly that code?
>
> Anthony
>
> On Sunday, May 13, 2012 4:43:24 AM UTC-4, BlueShadow wrote:
>>
>> Hi I got A table for articles on my page wich contains a variable for the
>> date it was submitted and the number of views (content title...)
>> I tried to do a select which gives me the newest five of this table
>> (orderedby=~article.date) Now I want to sort those five by the number of
>> views.
>> I tried it with appending the ordered by with |article.views and with
>> |~article.views but the result is the same I get the newest five sorted by
>> views but with the least views first.
>> I know I could reverse the order with some lines of python code but there
>> must be a simple way to do it.
>>
>