当前位置: 首页>>代码示例>>Python>>正文


Python DBSession.delete方法代码示例

本文整理汇总了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/'))
开发者ID:lento,项目名称:tagger,代码行数:9,代码来源:comment.py

示例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/'))
开发者ID:lento,项目名称:tagger,代码行数:9,代码来源:language.py

示例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/'))
开发者ID:lento,项目名称:tagger,代码行数:11,代码来源:category.py

示例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/'))
开发者ID:lento,项目名称:tagger,代码行数:11,代码来源:tag.py

示例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))
开发者ID:lento,项目名称:tagger,代码行数:11,代码来源:page.py

示例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/'))
开发者ID:lento,项目名称:tagger,代码行数:14,代码来源:article.py

示例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/'))
开发者ID:lento,项目名称:tagger,代码行数:12,代码来源:link.py


注:本文中的tagger.model.DBSession.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。