def render(self, context): announcements = get_latest_announcements(self.limit) if announcements and (int(self.limit) == 1): context[self.var_name] = announcements[0] else: context[self.var_name] = announcements return ''
def community(request): return render(request, 'accounts/community.html', { 'discussion_threads': DiscussionThread.objects.filter(is_public=True)[:10], 'announcements': get_latest_announcements(4), 'announce_calendar': get_announce_calendar(), 'updated_portfolios': get_recently_updated_portfolios(15) })
def items(self): return get_latest_announcements(50)