def getComments(self): """ Return the list of articles """ begin = self.getBegin() end = begin + self.getRange() orderBy = self.getOrderBy() reverse = self.getReverse() comments = list(AlineaComment.select("all", orderBy=AlineaComment.q.date, reversed=reverse)[begin:end]) return comments
def getAllComments(self): return list(AlineaComment.select("all", orderBy="id"))
def getComments(self, orderBy=AlineaComment.q.date): " return the last 10 comments " comments = list(AlineaComment.select("all", orderBy=orderBy, reversed=True)[0:10]) return comments
def getSize(self): query = AlineaComment.select() size = query.count() return size
def getComments(self, orderBy='date'): " return the last 10 comments " comments = list(AlineaComment.select('all',orderBy=orderBy, reversed=True)[0:10] ) return comments