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


Python Comment.get方法代码示例

本文整理汇总了Python中models.comment.Comment.get方法的典型用法代码示例。如果您正苦于以下问题:Python Comment.get方法的具体用法?Python Comment.get怎么用?Python Comment.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.comment.Comment的用法示例。


在下文中一共展示了Comment.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_comments_by_card_id

# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import get [as 别名]
    def test_get_comments_by_card_id(self):
        uid0 = User.add("test1", "password", "[email protected]")
        bid0 = Board.add("board1", "A")
        lid0 = List.add("To Do", bid0)

        caid0 = Card.add("card1", lid0, uid0)
        caid1 = Card.add("card2", lid0, uid0)

        coid0 = Comment.add(caid0, uid0, "comment1")
        coid1 = Comment.add(caid1, uid0, "comment2")

        comment0 = Comment.get(coid0)
        comment1 = Comment.get(coid1)

        assert coid0 in [comment.id for comment in Comment.get_comments_by_card_id(caid0)]
        assert coid1 not in [comment.id for comment in Comment.get_comments_by_card_id(caid0)]
开发者ID:GuangzheGao,项目名称:sorbitol,代码行数:18,代码来源:test_comment.py

示例2: post

# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import get [as 别名]
 def post(self, slug=None):
     try:
         linkcheck = self.request.get_all('checks')
         for key in linkcheck:
             comment = Comment.get(key)
             comment.delit()
     finally:
         self.redirect('/admin/comments')
开发者ID:oldhu,项目名称:micolog-oldhu,代码行数:10,代码来源:admin_comments.py

示例3: test_add_and_get

# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import get [as 别名]
 def test_add_and_get(self):
     uid0 = User.add("test1", "password", "[email protected]")
     bid0 = Board.add("board1", "A")
     lid0 = List.add("To Do", bid0)
     caid0 = Card.add("card1", lid0, uid0)
     coid0 = Comment.add(caid0, uid0, "comment1")
     comment0 = Comment.get(coid0)
     assert caid0 == comment0.card_id
     assert uid0 == comment0.user_id
     assert "comment1" == comment0.content
开发者ID:GuangzheGao,项目名称:sorbitol,代码行数:12,代码来源:test_comment.py

示例4: delete

# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import get [as 别名]
 def delete(self, content_id, comment_id):
     comment = Comment.get(int(comment_id))
     comment.delete()
     self.redirect('/content/' + content_id + "?action=comment.delete")
开发者ID:rcoronel-datalicious,项目名称:ph,代码行数:6,代码来源:content.py

示例5: comment_delete

# 需要导入模块: from models.comment import Comment [as 别名]
# 或者: from models.comment.Comment import get [as 别名]
def comment_delete(blog_id, comment_id):
    comment = Comment.get(comment_id)
    comment.delete()
    return redirect(url_for('blog_show',blog_id = blog_id))
开发者ID:yimun,项目名称:mygroup,代码行数:6,代码来源:app.py


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