Skip to content

PetrDlouhy/django-categories-api

Repository files navigation

Django Categories

codecov Run Tox tests Run Tox tests

This application provides basic django-rest-framework API for Django Categories.

Features of the project

The output contains category tree with counts of category items in each node (cummulative as well as direct counts).

Countable fields

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'),
  }

Settings

The cache timeout and staggering can be changed by:

  CATEGORIES_SETTINGS = {
      "CACHE_TIMEOUT": 60 * 60,
      "CACHE_STAGGERING": 60 * 10,
  }