Skip to main content

A Django library for sortable TabularInline in admin interface

Project description

django_sortable_tabular

django_sortable_tabular is a simple and lightweight Django library that enables column sorting for fields displayed in TabularInline in the Django admin panel.

Author

Michał Konwiak GitHub.

Features

  • Column sorting for TabularInline using JavaScript and Django.
  • Multi-column sorting with adjustable sort direction (ascending/descending).
  • Seamless integration with the Django admin interface through the SortableTabularInline class.

Requirements

  • Python 3.8+
  • Django 3.2+

Installation

  1. Install the library using pip:

    pip install django_sortable_tabular
    
  2. Add a package to INSTALLED_APPS section.

    INSTALLED_APPS = [
        # another apps
        'django_sortable_tabular',
    ]
    
  3. Define a class that extends the SortableTabularInline class and use it as you would a standard inline class. Here’s an example:

    class CommentAdmin(SortableTabularInline):
     model = Comment
    
    class PostAdmin(admin.ModelAdmin):
        list_display = (
            "title",
            "text",
            "picture",
            "author"
        )
        inlines = [
            CommentAdmin
        ]
    
  4. Run python manage.py collectstatic

  5. Run server and enjoy

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_sortable_tabular-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sortable_tabular-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file django_sortable_tabular-0.1.1.tar.gz.

File metadata

  • Download URL: django_sortable_tabular-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for django_sortable_tabular-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f1d5beef345cd4464b73657cfcfe4cca7ecad5a70b3d075e0d7a9015723d22d0
MD5 cc2d2bc07b82683c3898bed9fa94216c
BLAKE2b-256 b370f25e606bff682a440914fa5328e74318b301a6d08c22fa17c25fd21aafbe

See more details on using hashes here.

File details

Details for the file django_sortable_tabular-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sortable_tabular-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58c5c9c47ac8748a46945a033f322c395d89e387f36dc2d2f50fea1e51a198e0
MD5 0ef1bb0b7e4af3771399647c7e27f28b
BLAKE2b-256 487b3201be71249f33baf5d4dabdb390b01d405268edd437ac045ef8481906ee

See more details on using hashes here.

Supported by

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