This application provides basic django-rest-framework
API for Django Categories.
The output contains category tree with counts of category items in each node (cummulative as well as direct counts).
The API can contain number of related objects associatet with category.
This can be achieved by setting COUNTABLE_FIELD_RELATED_NAMES
property in CATEGORIES_SETTINGS
:
CATEGORIES_SETTINGS = {
"COUNTABLE_FIELD_RELATED_NAMES": ('field_name'),
}
The cache timeout and staggering can be changed by:
CATEGORIES_SETTINGS = {
"CACHE_TIMEOUT": 60 * 60,
"CACHE_STAGGERING": 60 * 10,
}