Metadata-Version: 2.4
Name: django-sitecats-helpers
Version: 1.1.0
Summary: django admin helper classes for django-sitecats categories
Author-email: Basil Shubin <basil.shubin@gmail.com>
License-Expression: MIT
Project-URL: download, https://github.com/bashu/django-sitecats-helpers/zipball/master
Project-URL: homepage, https://github.com/bashu/django-sitecats-helpers/
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: django>=5.2
Requires-Dist: django-sitecats>=1.2.2
Dynamic: license-file

django-sitecats-helpers
=======================

.. image:: https://badge.fury.io/py/django-sitecats-helpers.svg
    :target: https://badge.fury.io/py/django-sitecats-helpers

.. image:: https://img.shields.io/pypi/pyversions/django-sitecats-helpers.svg
    :target: https://pypi.python.org/pypi/django-sitecats-helpers/

.. image:: https://img.shields.io/pypi/djversions/django-sitecats-helpers.svg
    :target: https://pypi.python.org/pypi/django-sitecats-helpers/

.. image:: https://github.com/bashu/django-sitecats-helpers/actions/workflows/test.yml/badge.svg
    :target: https://github.com/bashu/django-sitecats-helpers/actions/workflows/test.yml

Django admin helper classes for django-sitecats_ categories.

Authored by `Basil Shubin <http://github.com/bashu>`_, inspired by django-taggit-helpers_

Installation
------------

First install the module, preferably in a virtual environment. It can be installed from PyPI:

.. code-block:: shell

    pip install django-sitecats-helpers

Setup
-----

First make sure the project is configured for django-sitecats_.

Then add the following settings:

.. code-block:: python

    INSTALLED_APPS += (
        'sitecats_helpers',
    )


Usage
-----

CategoryCounter
~~~~~~~~~~~~~~~

Display (and sort by) number of categories associated with objects.

.. code-block:: python

    from sitecats_helpers.admin import CategoryCounter

    class MyModelAdmin(CategoryCounter, admin.ModelAdmin):    # CategoryCounter before ModelAdmin
        list_display = (
            ...
            'category_counter',
        )

CategoryListFilter
~~~~~~~~~~~~~~~~~~

Filter records by categories for the current model only.

.. code-block:: python

    from sitecats_helpers.admin import CategoryListFilter

    class MyModelAdmin(admin.ModelAdmin):
        list_filter = [CategoryListFilter]

CategoryStackedInline
~~~~~~~~~~~~~~~~~~~~~

Add stacked inline for categories to admin.

.. code-block:: python

    from sitecats_helpers.admin import CategoryStackedInline

    class MyModelAdmin(admin.ModelAdmin):
        inlines = [CategoryStackedInline]

CategoryTabularInline
~~~~~~~~~~~~~~~~~~~~~

Add tabular inline for categorise to admin.

.. code-block:: python

    from sitecats_helpers.admin import CategoryTabularInline

    class MyModelAdmin(admin.ModelAdmin):
        inlines = [CategoryTabularInline]

Contributing
------------

If you like this module, forked it, or would like to improve it, please let us know!
Pull requests are welcome too. :-)

License
-------

``django-sitecats-helpers`` is released under the MIT license.

.. _django-sitecats: https://github.com/idlesign/django-sitecats
.. _django-taggit-helpers: https://github.com/mfcovington/django-taggit-helpers

Changes
-------

1.1.0 (2026-08-14)
~~~~~~~~~~~~~~~~~~

* Dropped Python 3.6-3.9 support; now requires Python 3.10-3.14.
* Dropped Django 2.2-3.2 support; now requires Django 5.2-6.1.
* Require ``django-sitecats>=1.2.2`` explicitly (Django 4+ support was introduced there; dependency was previously unpinned).

1.0.1 (2021-11-30)
~~~~~~~~~~~~~~~~~~

* Add missing mo files.

1.0.0 (2021-11-29)
~~~~~~~~~~~~~~~~~~

* Added Django 3+ support.
* Dropped Python 2.7 support.
* Dropped Django 1.10 / 1.11 support.
