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


Python Post.set_parent方法代码示例

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


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

示例1: reply_post_3

# 需要导入模块: from assembl.models import Post [as 别名]
# 或者: from assembl.models.Post import set_parent [as 别名]
def reply_post_3(request, participant2_user, discussion,
                 root_post_1, test_session):
    """
    From participant2_user, in reply to reply_post_2
    """
    from assembl.models import Post
    p = Post(
        discussion=discussion, creator=participant2_user,
        subject=u"re2: root post", body=u"post body",
        type="post", message_id="msg4")
    test_session.add(p)
    test_session.flush()
    p.set_parent(root_post_1)
    test_session.flush()

    def fin():
        print "finalizer reply_post_3"
        test_session.delete(p)
        test_session.flush()
    request.addfinalizer(fin)
    return p
开发者ID:iilab,项目名称:assembl,代码行数:23,代码来源:pytest_fixtures.py

示例2: reply_post_2

# 需要导入模块: from assembl.models import Post [as 别名]
# 或者: from assembl.models.Post import set_parent [as 别名]
def reply_post_2(request, participant1_user, discussion,
                 reply_post_1, test_session):
    """
    From participant1_user, in reply to reply_post_1
    """
    from assembl.models import Post
    p = Post(
        discussion=discussion, creator=participant1_user,
        subject=u"re2: root post", body=u"post body",
        creation_date=datetime(year=2000, month=1, day=5),
        type="post", message_id="msg3")
    test_session.add(p)
    test_session.flush()
    p.set_parent(reply_post_1)
    test_session.flush()

    def fin():
        print "finalizer reply_post_2"
        test_session.delete(p)
        test_session.flush()
    request.addfinalizer(fin)
    return p
开发者ID:mydigilife,项目名称:assembl,代码行数:24,代码来源:pytest_fixtures.py

示例3: reply_to_deleted_post_5

# 需要导入模块: from assembl.models import Post [as 别名]
# 或者: from assembl.models.Post import set_parent [as 别名]
def reply_to_deleted_post_5(
        request, participant1_user, discussion,
        reply_deleted_post_4, test_session):
    """
    From participant2_user, in reply to root_post_1
    """
    from assembl.models import Post, LangString
    p = Post(
        discussion=discussion, creator=participant1_user,
        subject=LangString.create(u"re3: root post"),
        body=LangString.create(u"post body"),
        type="post", message_id="[email protected]")
    test_session.add(p)
    test_session.flush()
    p.set_parent(reply_deleted_post_4)
    test_session.flush()

    def fin():
        print "finalizer reply_to_deleted_post_5"
        test_session.delete(p)
        test_session.flush()
    request.addfinalizer(fin)
    return p
开发者ID:assembl,项目名称:assembl,代码行数:25,代码来源:posts.py

示例4: reply_deleted_post_4

# 需要导入模块: from assembl.models import Post [as 别名]
# 或者: from assembl.models.Post import set_parent [as 别名]
def reply_deleted_post_4(request, participant2_user, discussion,
                         reply_post_1, test_session):
    """
    From participant2_user, in reply to reply_post_1
    """
    from assembl.models import Post, LangString, PublicationStates
    p = Post(
        discussion=discussion, creator=participant2_user,
        subject=LangString.create(u"re2: root post"),
        body=LangString.create(u"post body"),
        publication_state=PublicationStates.DELETED_BY_ADMIN,
        type="post", message_id="[email protected]")
    test_session.add(p)
    test_session.flush()
    p.set_parent(reply_post_1)
    test_session.flush()

    def fin():
        print "finalizer reply_deleted_post_4"
        test_session.delete(p)
        test_session.flush()
    request.addfinalizer(fin)
    return p
开发者ID:assembl,项目名称:assembl,代码行数:25,代码来源:posts.py

示例5: reply_post_1

# 需要导入模块: from assembl.models import Post [as 别名]
# 或者: from assembl.models.Post import set_parent [as 别名]
def reply_post_1(request, participant2_user, discussion,
                 root_post_1, test_session):
    """
    From participant2_user, in reply to root_post_1
    """
    from assembl.models import Post, LangString
    p = Post(
        discussion=discussion, creator=participant2_user,
        subject=LangString.create(u"re1: root post"),
        body=LangString.create(u"post body with some text so we can test harvesting features. I'm writing a very topical comment with an unrelated source, hoping it would make people angry and make them write answers. I have read in '17O Solid-State NMR Spectroscopy of Functional Oxides for Energy Conversion' thesis by Halat, D. M. (2018) that variable-temperature spectra indicate the onset of oxide-ion motion involving the interstitials at 130 °C, which is linked to an orthorhombic−tetragonal phase transition. For the V-doped phases, an oxide-ion conduction mechanism is observed that involves oxygen exchange between the Bi-O sublattice and rapidly rotating VO4 tetrahedral units. The more poorly conducting P-doped phase exhibits only vacancy conduction with no evidence of sublattice exchange, a result ascribed to the differing propensities of the dopants to undergo variable oxygen coordination. So I think it would be a very bad idea to allow hot beverages in coworking spaces. But it looks like people don't really care about scientific evidence around here."),
        creation_date=datetime(year=2000, month=1, day=4),
        type="post", message_id="[email protected]")
    test_session.add(p)
    test_session.flush()
    p.set_parent(root_post_1)
    test_session.flush()

    def fin():
        print "finalizer reply_post_1"
        test_session.delete(p)
        test_session.flush()
    request.addfinalizer(fin)
    return p
开发者ID:assembl,项目名称:assembl,代码行数:25,代码来源:posts.py

示例6: reply_post_1

# 需要导入模块: from assembl.models import Post [as 别名]
# 或者: from assembl.models.Post import set_parent [as 别名]
def reply_post_1(request, participant2_user, discussion,
                 root_post_1, test_session):
    """
    From participant2_user, in reply to root_post_1
    """
    from assembl.models import Post, LangString
    p = Post(
        discussion=discussion, creator=participant2_user,
        subject=LangString.create(u"re1: root post"),
        body=LangString.create(u"post body"),
        creation_date=datetime(year=2000, month=1, day=4),
        type="post", message_id="[email protected]")
    test_session.add(p)
    test_session.flush()
    p.set_parent(root_post_1)
    test_session.flush()

    def fin():
        print "finalizer reply_post_1"
        test_session.delete(p)
        test_session.flush()
    request.addfinalizer(fin)
    return p
开发者ID:Lornz-,项目名称:assembl,代码行数:25,代码来源:pytest_fixtures.py


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