Exemple #1
0
 def query_by_postid(postid, limit=5):
     recs = TabPostHist.select().where(
         TabPostHist.post_id == postid
     ).order_by(
         TabPostHist.time_update.desc()
     ).limit(limit)
     return recs
Exemple #2
0
 def query_by_postid(postid, limit=5):
     '''
     Query history of certian records.
     '''
     recs = TabPostHist.select().where(
         TabPostHist.post_id == postid).order_by(
             TabPostHist.time_update.desc()).limit(limit)
     return recs
Exemple #3
0
 def get_last(postid, limit=10):
     recs = TabPostHist.select().where(
         TabPostHist.post_id == postid
     ).order_by(TabPostHist.time_update.desc()).limit(limit)
     if recs.count() == 0:
         return None
     else:
         return recs.get()
Exemple #4
0
 def get_last(postid, limit=10):
     '''
     Get the last one of the records.
     '''
     recs = TabPostHist.select().where(
         TabPostHist.post_id == postid).order_by(
             TabPostHist.time_update.desc()).limit(limit)
     if recs.count():
         return recs.get()
     return None