def getArticles(self,orderBy='date'): " return the last 10 articles " articles = list(AlineaArticle.select(AlineaArticle.q.published==True, orderBy=orderBy, reversed=True)[0:10] ) return articles
def getPopularArticles(self): # ,orderBy='-hits' return AlineaArticle.select('all', orderBy=-AlineaArticle.q.hits)[:10]