i have some tables to rate files by week, month, year etc..
i have some function like this:
def index():
if request.args(0) == 'all':
rolics =
db(db.rolic.id==db.rating_all.rolic_id).select(db.rolic.all,
db.rating_all.rating, orderby=~db.rating_all.rating)
elif request.args(0) == 'year':
rolics =
db(db.rolic.id==db.rating_year.rolic_id).select(db.rolic.all,
db.rating_year.rating, orderby=~db.rating_year.rating)
return response.render('default/main.html', dict(rolics=rolics))
so the question is:
is there any way to rename the keys of dict, because template doesn't
know about type of query:
something like:
rolics =
db(db.rolic.id==db.rating_all.rolic_id).select(db.rolic.all,
db.rating_all.rating AS 'rolic.rating', orderby=~db.rating_all.rating)
to use it in template like this:
{{for rolic in rolics:}}
{{=rolic.rating}}
{{pass}}
sry for my bad english