I would like to make a queryset on a generic view in this way:
category_info = {
'queryset' : ModelObject.objects.filter(category=category_id)
}
where the category_id will be stated on the URL
(r'^category/(?P<category_id>\d+)$', 'object_list', category_info )
But I don’t know how to take the data from the URL and pass it to the category info…
You’ll have to define your own view and return the generic view from within:
urls.py:
myapp/views.py
You can also customise the generic view further, using the parameters mentioned in the documentation. (You may like to also verify that the category exists, throwing a 404 when it doesn’t)