Skip to main content

django admin helper classes for django-sitecats categories

Project description

https://img.shields.io/pypi/v/django-sitecats-helpers.svg https://img.shields.io/pypi/dm/django-sitecats-helpers.svg https://img.shields.io/github/license/bashu/django-sitecats-helpers.svg

Django admin helper classes for django-sitecats categories.

Authored by Basil Shubin, inspired by django-taggit-helpers

Installation

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

pip install django-sitecats-helpers

Setup

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

Then add the following settings:

INSTALLED_APPS += (
    'sitecats_helpers',
)

Usage

CategoryCounter

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

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.

from sitecats_helpers.admin import CategoryListFilter

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

CategoryStackedInline

Add stacked inline for categories to admin.

from sitecats_helpers.admin import CategoryStackedInline

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

CategoryTabularInline

Add tabular inline for categorise to admin.

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.

Changes

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sitecats-helpers-1.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

django_sitecats_helpers-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file django-sitecats-helpers-1.0.1.tar.gz.

File metadata

  • Download URL: django-sitecats-helpers-1.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for django-sitecats-helpers-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8ba18af2b95565f0b03076a5543870dc4b08f32f6760164eb90a7a10d847c288
MD5 98480856e89d3d164f6d291338588fa6
BLAKE2b-256 b406485a79ec1ca751316a815abdd8ed9e519030f5ec688813eed9999cd1d8ae

See more details on using hashes here.

File details

Details for the file django_sitecats_helpers-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_sitecats_helpers-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for django_sitecats_helpers-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 124e688c371acc577a01f353a893cd5afcc5426b3c189e3a917c4c8e46d3fdea
MD5 458645eee9b433258ecd578541d475f6
BLAKE2b-256 758eee67e59d541460dcbec555958829838b16c7cdf582d87b6b4025b04c9c78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page