Example #1
0
 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
Example #2
0
 def getPopularArticles(self):
     # ,orderBy='-hits'
     return AlineaArticle.select('all', orderBy=-AlineaArticle.q.hits)[:10]