本文整理汇总了Python中tagger.model.DBSession.delete方法的典型用法代码示例。如果您正苦于以下问题:Python DBSession.delete方法的具体用法?Python DBSession.delete怎么用?Python DBSession.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tagger.model.DBSession
的用法示例。
在下文中一共展示了DBSession.delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, commentid):
"""Delete a Comment"""
comment = DBSession.query(Comment).get(commentid)
DBSession.delete(comment)
flash('%s %s' % (_('Deleted Comment:'), comment.id), 'ok')
return dict(redirect_to=url('/admin/comment/'))
示例2: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, languageid):
"""Delete a Language"""
language = DBSession.query(Language).get(languageid.decode())
DBSession.delete(language)
flash('%s %s' % (_('Deleted Language:'), language.id), 'ok')
return dict(redirect_to=url('/admin/language/'))
示例3: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, categoryid):
"""Delete a Category"""
category = DBSession.query(Category).get(categoryid.decode())
for categorydata in category.data:
DBSession.delete(categorydata)
DBSession.delete(category)
flash('%s %s' % (_('Deleted Category:'), category.id), 'ok')
return dict(redirect_to=url('/admin/category/'))
示例4: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, tagid):
"""Delete a Tag"""
tag = DBSession.query(Tag).get(tagid.decode())
for tagdata in tag.data:
DBSession.delete(tagdata)
DBSession.delete(tag)
flash('%s %s' % (_('Deleted Tag:'), tag.id), 'ok')
return dict(redirect_to=url('/admin/tag/'))
示例5: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, pageid):
"""Delete a Page"""
page = DBSession.query(Page).get(pageid)
for pagedata in page.data:
DBSession.delete(pagedata)
DBSession.delete(page)
flash('%s %s' % (_('Deleted Page:'), page.string_id), 'ok')
return dict(redirect_to=url('/article/%s/edit' % page.article.id))
示例6: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, articleid):
"""Delete a Article"""
article = DBSession.query(Article).get(articleid.decode())
for page in article.pages:
for pagedata in page.data:
DBSession.delete(pagedata)
DBSession.delete(page)
DBSession.delete(article.associable)
DBSession.delete(article)
flash('%s %s' % (_('Deleted Article:'), article.id), 'ok')
return dict(redirect_to=url('/admin/article/'))
示例7: post_delete
# 需要导入模块: from tagger.model import DBSession [as 别名]
# 或者: from tagger.model.DBSession import delete [as 别名]
def post_delete(self, linkid):
"""Delete a Link"""
link = DBSession.query(Link).get(linkid.decode())
for linkdata in link.data:
DBSession.delete(linkdata)
DBSession.delete(link.associable)
DBSession.delete(link)
flash('%s %s' % (_('Deleted Link:'), link.id), 'ok')
return dict(redirect_to=url('/admin/link/'))