本文整理汇总了Python中the_tale.game.bills.prototypes.BillPrototype.get_recently_modified_bills方法的典型用法代码示例。如果您正苦于以下问题:Python BillPrototype.get_recently_modified_bills方法的具体用法?Python BillPrototype.get_recently_modified_bills怎么用?Python BillPrototype.get_recently_modified_bills使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.game.bills.prototypes.BillPrototype
的用法示例。
在下文中一共展示了BillPrototype.get_recently_modified_bills方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from the_tale.game.bills.prototypes import BillPrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.BillPrototype import get_recently_modified_bills [as 别名]
def index(self):
if portal_settings.ENABLE_FIRST_TIME_REDIRECT and accounts_logic.is_first_time_visit(self.request):
return self.redirect(random.choice(portal_settings.FIRST_TIME_LANDING_URLS))
news = news_logic.load_news_from_query(news_models.News.objects.all().order_by('-created_at')[:portal_settings.NEWS_ON_INDEX])
bills = BillPrototype.get_recently_modified_bills(portal_settings.BILLS_ON_INDEX)
account_of_the_day_id = settings.get(portal_settings.SETTINGS_ACCOUNT_OF_THE_DAY_KEY)
hero_of_the_day = None
account_of_the_day = None
clan_of_the_day = None
if account_of_the_day_id is not None:
hero_of_the_day = heroes_logic.load_hero(account_id=account_of_the_day_id)
account_of_the_day = AccountPrototype.get_by_id(account_of_the_day_id)
if account_of_the_day.clan_id is not None:
clan_of_the_day = ClanPrototype.get_by_id(account_of_the_day.clan_id)
forum_threads = ThreadPrototype.get_last_threads(account=self.account if self.account.is_authenticated() else None,
limit=portal_settings.FORUM_THREADS_ON_INDEX)
blog_posts = [ BlogPostPrototype(blog_post_model)
for blog_post_model in BlogPost.objects.filter(state__in=[BLOG_POST_STATE.ACCEPTED, BLOG_POST_STATE.NOT_MODERATED],
votes__gte=0).order_by('-created_at')[:portal_settings.BLOG_POSTS_ON_INDEX] ]
map_info = map_info_storage.item
chronicle_records = ChronicleRecordPrototype.get_last_records(portal_settings.CHRONICLE_RECORDS_ON_INDEX)
chronicle_actors = RecordToActorPrototype.get_actors_for_records(chronicle_records)
return self.template('portal/index.html',
{'news': news,
'forum_threads': forum_threads,
'bills': bills,
'hero_of_the_day': hero_of_the_day,
'account_of_the_day': account_of_the_day,
'clan_of_the_day': clan_of_the_day,
'map_info': map_info,
'blog_posts': blog_posts,
'TERRAIN': TERRAIN,
'MAP_STATISTICS': MAP_STATISTICS,
'chronicle_records': chronicle_records,
'chronicle_actors': chronicle_actors,
'RACE': RACE})