diff --git a/shopelectro/context.py b/shopelectro/context.py index 572e9a6b..7383cae5 100644 --- a/shopelectro/context.py +++ b/shopelectro/context.py @@ -4,8 +4,11 @@ It stands between urls and view functions. Every context class is used via objects composition. -For example: -TODO - add example of objects composition +Code example to create tagged: + +>>> from django.http import HttpRequest +>>> url_kwargs = {'slug': 'my-page'} +>>> Category(url_kwargs, request=HttpRequest()) | TaggedCategory() """ import typing diff --git a/shopelectro/views/catalog.py b/shopelectro/views/catalog.py index f8098f1f..3e97f214 100644 --- a/shopelectro/views/catalog.py +++ b/shopelectro/views/catalog.py @@ -193,8 +193,8 @@ def get_context_data(self, **kwargs): context.Category(self.kwargs, self.request) | context.TaggedCategory() | context.SortingCategory() - | context.PaginationCategory() - | context.DBTemplate() + | context.PaginationCategory() # requires SortingCategory + | context.DBTemplate() # requires TaggedCategory ) return { **super().get_context_data(**kwargs),