rows are storage objects...
rows = []
for row in rows1:
row.table_name = 'news'
rows.append(row)
for row in rows2:
row.table_name = 'article'
rows.append(row)
should work as intended.
Il giorno giovedì 24 maggio 2012 13:53:38 UTC+2, CtrlSoft ha scritto:
>
> added_on field
added_on field is datetime, so i want to sort rows by date time
rows = rows.sort(lambda row: row.added_on)
the main idea consist in showing last 10 added articles or news, ordered by
added_on field
it can be 7 news or 3 articles
5 news 5 articles
1 news 9 artilces
Why not just:
def index():
news = db(db.news.public == True).select(orderby=~db.news.added_on,limitby
=(0,10))
articles = db(db.articles.public == True).select(orderby=~db.articles.
added_on, limitby=(0,10))
return dict(news=news, articles=articles)
{{for row in news:}}
{{=H4(A(ro
3 matches
Mail list logo