Advertisement
SalahAdDinYusuf

MenuMixin

Jul 23rd, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. class MenuMixin(object):
  2.     def get_context_data(self, **kwargs):
  3.         context = super(object, self).get_context_data(**kwargs)
  4.         context['lates'] = self.model.objects.all()[:20]
  5.         context['local'] = self.model.objects.filter(subtopic='Local')[:20]
  6.         context['featured'] = self.model.objects.order_by('times_viewed')[:20]
  7.         return context
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement