Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

list view render queryset

class BookListView(generic.ListView):
    model = Book
    context_object_name = 'my_book_list'   
    queryset = Book.objects.all() 
    template_name = 'books/my_arbitrary_template_name_list.html'

    def get_context_data(self, **kwargs):
        context = super(BookListView, self).get_context_data(**kwargs)
        context['second_queryset'] = # YOUR QUERY HERE
        return context
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #view #render #queryset
ADD COMMENT
Topic
Name
9+5 =