def get_by_wiki(self, citiao): tt = CabWiki.select().where(CabWiki.title == citiao).count() if tt == 0: return None else: self.update_view_count(citiao) return CabWiki.get(CabWiki.title == citiao)
def get_by_title(self, in_title): try: return CabWiki.get(CabWiki.title == in_title) except: return None
def get_by_id(self, in_uid): tt = CabWiki.select().where(CabWiki.uid == in_uid).count() if tt == 0: return None else: return CabWiki.get(CabWiki.uid == in_uid)