I need to pass id from the url slug. I am using generic views. This is my code for urls.py:

```
path('category/<int:pk>/details/',
         CategoryDetailView.as_view(),
         name='category-details'),

```

and I need to pass the `<int:pk>` value into views.py, so I can filter my queryset with this id.

 My views.py code:

```
class CategoryDetailView(DetailView):
    model = Category
    def get_context_data(self, *, object_list=Expense.objects.get_queryset(), **kwargs):
        queryset = object_list
        return super().get_context_data(
            summary_per_year_month = summary_per_year_month(queryset.filter(category_id= <int:pk> ))
        )

```