Example #1
0
 def get_context_data(self, **kwargs):
     context = super(RootView, self).get_context_data(**kwargs)
     for i,j in ([NEWS, News.objects.all()[:3]],
                 [ANNOUNCES, Announce.get_and_check()]):
         context[i] = j
     context[ANNOUNCES + '_count'] = range(0, len(context[ANNOUNCES]))
     return context
Example #2
0
 def get_context_data(self, **kwargs):
     context = super(AnnouncesView, self).get_context_data(**kwargs)
     context[ANNOUNCES] = Announce.get_and_check()
     return context