def article_delete_lib(self, article_id): article = Article.by_id(article_id) if article is None: return Article.all() self.db.delete(article) self.db.commit() return Article.all()
def articles_delete_lib(self, article_id): if article_id is None: return {'status': False, 'msg': '文章ID 不存在'} article = Article.by_id(article_id) if article is None: return Article.all() self.db.delete(article) self.db.commit() return Article.all()
def article_delete_lib(self, article_id): '''删除文章''' article = Article.by_id(article_id) if article is None: return Article.all() self.db.delete(article) self.db.commit() # flash (self, '请输入角色名称!', 'error') return Article.all()
def articles_modify_list_lib(self): articles = Article.all() return articles
def get_articles(): ''' 返回所有文章给修改文章的主页 ''' articles = Article.all() return articles
def articles_modify_list_lib(): '''文章管理''' articles = Article.all() return articles
def get_all_article_lib(self): articles = Article.all() return articles