本文整理汇总了Python中the_tale.forum.prototypes.ThreadPrototype.save方法的典型用法代码示例。如果您正苦于以下问题:Python ThreadPrototype.save方法的具体用法?Python ThreadPrototype.save怎么用?Python ThreadPrototype.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.forum.prototypes.ThreadPrototype
的用法示例。
在下文中一共展示了ThreadPrototype.save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: from the_tale.forum.prototypes import ThreadPrototype [as 别名]
# 或者: from the_tale.forum.prototypes.ThreadPrototype import save [as 别名]
def update(self, form):
Vote.objects.filter(bill_id=self.id).delete()
VotePrototype.create(self.owner, self, VOTE_TYPE.FOR)
self.data.initialize_with_user_data(form)
self._model.updated_at = datetime.datetime.now()
self._model.caption = form.c.caption
self._model.rationale = form.c.rationale
self._model.approved_by_moderator = False
self._model.chronicle_on_accepted = form.c.chronicle_on_accepted
self.recalculate_votes()
self.save()
ActorPrototype.update_actors(self, self.data.actors)
thread = ThreadPrototype(self._model.forum_thread)
thread.caption = form.c.caption
thread.save()
text = u'[url="%s%s"]Законопроект[/url] был отредактирован, все голоса сброшены.' % (project_settings.SITE_URL,
reverse('game:bills:show', args=[self.id]) )
PostPrototype.create(thread,
get_system_user(),
self.bill_info_text(text),
technical=True)
signals.bill_edited.send(self.__class__, bill=self)
示例2: remove
# 需要导入模块: from the_tale.forum.prototypes import ThreadPrototype [as 别名]
# 或者: from the_tale.forum.prototypes.ThreadPrototype import save [as 别名]
def remove(self, initiator):
self.set_remove_initiator(initiator)
self.state = BILL_STATE.REMOVED
self.save()
thread = ThreadPrototype(self._model.forum_thread)
thread.caption = thread.caption + u" [удалён]"
thread.save()
PostPrototype.create(thread, get_system_user(), u"Законопроект был удалён", technical=True)
signals.bill_removed.send(self.__class__, bill=self)
示例3: decline
# 需要导入模块: from the_tale.forum.prototypes import ThreadPrototype [as 别名]
# 或者: from the_tale.forum.prototypes.ThreadPrototype import save [as 别名]
def decline(self, moderator):
self.state = relations.POST_STATE.DECLINED
self.moderator_id = moderator.id
self.save()
thread = ForumThreadPrototype(self._model.forum_thread)
thread.caption = thread.caption + u' [удалён]'
thread.save()
ForumPostPrototype.create(thread,
get_system_user(),
u'Произведение было удалено',
technical=True)