def home(request): now = datetime.now() later = now + timedelta(seconds=30 * 86400) upcoming_events = mybb.get_events_in_range("Default Calendar", now, later)[:7] latest_article = mybb.get_threads( forum_name="News and Announcements", count=1, orderby="mybb_threads.dateline", sort="DESC" )[0] recent_articles = mybb.get_threads( forum_name="News and Announcements", count=7, offsetby=1, orderby="mybb_threads.dateline", sort="DESC" ) recent_discussions = mybb.get_threads( forum_name=settings.DISCUSSION_FORUMS, count=7, orderby="mybb_threads.dateline", sort="DESC" ) ladder_na = get_leaderboard(region=BATTLENET_REGION_NA, orderby="ladder_points", sort="DESC", count=10) ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby="ladder_points", sort="DESC", count=10) ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby="ladder_points", sort="DESC", count=10) return render( request, "site_home.html", dict( upcoming_events=upcoming_events, latest_article=latest_article, recent_articles=recent_articles, recent_discussions=recent_discussions, ladder_na=ladder_na, ladder_eu=ladder_eu, ladder_kr=ladder_kr, ), )
def home(request): recent_discussions = mybb.get_threads( forum_name=settings.DISCUSSION_FORUMS, count=7, orderby="mybb_threads.dateline", sort="DESC") ladder_na = get_leaderboard( region=BATTLENET_REGION_NA, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) ladder_eu = get_leaderboard( region=BATTLENET_REGION_EU, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) ladder_kr = get_leaderboard( region=BATTLENET_REGION_KR, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) online_streams = StreamInfo.objects.filter( online=True).order_by('-viewers')[:7] return render( request, 'site_home.html', dict( recent_discussions=recent_discussions, ladder_na=ladder_na, ladder_eu=ladder_eu, ladder_kr=ladder_kr, online_streams=online_streams, ))
def starbowmodweb(request): now = datetime.now() later = now+timedelta(seconds=30*86400) return dict( ABOUT_PAGES=settings.ABOUT_PAGES, recent_articles=mybb.get_threads(forum_name="News and Announcements", orderby="mybb_threads.dateline", sort="DESC", count=7), upcoming_events=mybb.get_events_in_range("Default Calendar", now, later)[:7], )
def home(request): now = datetime.now() later = now + timedelta(seconds=30 * 86400) upcoming_events = mybb.get_events_in_range("Default Calendar", now, later)[:7] latest_article = mybb.get_threads(forum_name="News and Announcements", count=1, orderby="mybb_threads.dateline", sort="DESC")[0] recent_articles = mybb.get_threads(forum_name="News and Announcements", count=7, offsetby=1, orderby="mybb_threads.dateline", sort="DESC") recent_discussions = mybb.get_threads( forum_name=settings.DISCUSSION_FORUMS, count=7, orderby="mybb_threads.dateline", sort="DESC") ladder_na = get_leaderboard(region=BATTLENET_REGION_NA, orderby='ladder_points', sort="DESC", count=10) ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby='ladder_points', sort="DESC", count=10) ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby='ladder_points', sort="DESC", count=10) return render( request, 'site_home.html', dict( upcoming_events=upcoming_events, latest_article=latest_article, recent_articles=recent_articles, recent_discussions=recent_discussions, ladder_na=ladder_na, ladder_eu=ladder_eu, ladder_kr=ladder_kr, ))
def home(request): recent_discussions = mybb.get_threads(forum_name=settings.DISCUSSION_FORUMS, count=7, orderby="mybb_threads.dateline", sort="DESC") ladder_na = get_leaderboard(region=BATTLENET_REGION_NA, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) return render(request, 'site_home.html', dict( recent_discussions=recent_discussions, ladder_na=ladder_na, ladder_eu=ladder_eu, ladder_kr=ladder_kr, ))
def starbowmodweb(request): now = datetime.now() later = now + timedelta(seconds=30 * 86400) return dict( ABOUT_PAGES=settings.ABOUT_PAGES, recent_articles=mybb.get_threads(forum_name="News and Announcements", orderby="mybb_threads.dateline", sort="DESC", count=7), upcoming_events=mybb.get_events_in_range("Default Calendar", now, later)[:7], )
def home(request): recent_discussions = mybb.get_threads(forum_name=settings.DISCUSSION_FORUMS, count=7, orderby="mybb_threads.dateline", sort="DESC") ladder_na = get_leaderboard(region=BATTLENET_REGION_NA, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) ladder_eu = get_leaderboard(region=BATTLENET_REGION_EU, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) ladder_kr = get_leaderboard(region=BATTLENET_REGION_KR, orderby=['division__ladder_group', 'ladder_points'], sort="DESC", count=10) online_streams = StreamInfo.objects.filter(online=True).order_by('-viewers')[:7] return render(request, 'site_home.html', dict( recent_discussions=recent_discussions, ladder_na=ladder_na, ladder_eu=ladder_eu, ladder_kr=ladder_kr, online_streams=online_streams, ))
def view_news(request): articles = mybb.get_threads(forum_name="News and Announcements", orderby="mybb_threads.dateline", sort="DESC") return render(request, 'news.html', dict(articles=articles))