本文整理匯總了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
示例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
示例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
示例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
示例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
示例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