Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class YourListView(ListView):
- def get_context_data(self, **kwargs):
- categories = Category.objects.select_related('parent')\
- .prefetch_related('translations').get_cached_trees()
- context['categories'] = categories
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement