Skip to main content

Simple Integer-based Ordering for Django Models

Project description

Django Simple Ordering

A package for adding simple integer-based ordering to your Django models.

Installation

Run the following command to install django-simple-ordering package.

pip install django-simple-ordering

Usage

Follow the below steps to add ordering to your models:

  1. Make sure django_simple_ordering and django_object_actions exist in your Django project INSTALLED_APPS setting. This is because this package relies on the django-object-actions package for implementing changelist actions.
INSTALLED_APPS = [
    # Django Applications ...

    "django_object_actions",
    "django_simple_ordering",

    # Your Applications ...
]
  1. Add the SimpleOrderingModelMixin to your model:
from django.db import models

from django_simple_ordering.models import SimpleOrderingModelMixin


class Book(SimpleOrderingModelMixin, models.Model):
    title = models.CharField(max_length=100, unique=True)

    class Meta(SimpleOrderingModelMixin.Meta):
        verbose_name = "book"
        verbose_name_plural = "books"
  1. Add the SimpleOrderingModelAdminMixin to your model admin:
from django.contrib import admin

from django_simple_ordering import SimpleOrderingModelAdminMixin


@admin.register(Book)
class BookAdmin(SimpleOrderingModelAdminMixin, admin.ModelAdmin):
    list_display = ("title",)

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_simple_ordering-1.0.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

django_simple_ordering-1.0.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file django_simple_ordering-1.0.2.tar.gz.

File metadata

  • Download URL: django_simple_ordering-1.0.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_simple_ordering-1.0.2.tar.gz
Algorithm Hash digest
SHA256 af0a8290f4eee05ee3e34c44ef649f0881ec9e4d705dde9026cdbccdd83a6294
MD5 2806443568affcdfff1f4ed467edb6ad
BLAKE2b-256 b553451d94bdda52081a611d4f9d4a30a6cde551adcf13b3519efb9cbf89a4b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_simple_ordering-1.0.2.tar.gz:

Publisher: python-package-publish.yaml on aminvsf/django-simple-ordering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_simple_ordering-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_simple_ordering-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f0cbda1d303e8c90a462f2dcc70a812af500ee34ea99b81da225d2708b55380
MD5 4a513ef54058d224af55066f5f8eaf65
BLAKE2b-256 de40bd64b743460d7dd783a2cacf15421de493925df4f754c813368283918d0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_simple_ordering-1.0.2-py3-none-any.whl:

Publisher: python-package-publish.yaml on aminvsf/django-simple-ordering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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