本文整理汇总了Python中assembl.models.Idea.tombstone_condition方法的典型用法代码示例。如果您正苦于以下问题:Python Idea.tombstone_condition方法的具体用法?Python Idea.tombstone_condition怎么用?Python Idea.tombstone_condition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assembl.models.Idea
的用法示例。
在下文中一共展示了Idea.tombstone_condition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_indexable_contents
# 需要导入模块: from assembl.models import Idea [as 别名]
# 或者: from assembl.models.Idea import tombstone_condition [as 别名]
def get_indexable_contents(session):
from assembl.models import AgentProfile, Idea, Post
from assembl.models.post import PublicationStates
query = session.query(Idea
).filter(Idea.tombstone_condition()
).filter(Idea.hidden==False
).options(
joinedload(Idea.title).joinedload("entries"),
joinedload(Idea.synthesis_title).joinedload("entries"),
joinedload(Idea.description).joinedload("entries")
)
for idea in query:
yield idea
query = session.query(AgentProfile)
for user in query:
yield user
AllPost = with_polymorphic(Post, '*')
query = session.query(AllPost
).filter(AllPost.tombstone_condition()
).filter(AllPost.hidden==False
).filter(AllPost.publication_state == PublicationStates.PUBLISHED
).options(
joinedload(AllPost.subject).joinedload("entries"),
joinedload(AllPost.body).joinedload("entries")
)
for post in query:
for extract in post.extracts:
yield extract
yield post