def load_related(self): """ Load related objects using 1 SQL query instead of len(qs) queries """ qs = self.get_queryset() return load_content_objects(qs, cache_field='object', field='object_id', ct_field='content_type')
def forum_subscription(request): """ Shows forum subscriptions """ profile = request.user.get_profile() subscription = load_content_objects(profile.forum_subscription.order_by('-date')) subscription_list = paginate(request, subscription, settings.SUBSCRIPTIONS_PER_PAGE) return { 'subscription_list': subscription_list, }
def forum_subscription(request): """ Shows forum subscriptions """ profile = request.user.profile subscription = load_content_objects( profile.forum_subscription.order_by('-date')) subscription_list = paginate(request, subscription, settings.SUBSCRIPTIONS_PER_PAGE) return { 'subscription_list': subscription_list, }
def load_related(self): """ Load related objects using 1 SQL query instead of len(qs) queries """ qs = self.get_query_set() return load_content_objects(qs, cache_field='object', field='object_id', ct_field='content_type')