def create(self,title,alias,content): id = Ticket().get_ticket() acticle = ArticleModel() acticle.set_article( {'id':id,'title':title,'alias':alias,'content':content}) return acticle.save()
def get_article_by_id(self, id): article = ArticleModel() if article.set_id(id).get(): return article else: return None