Skip to main content

Mixin inlines and fieldsets in Django admin.

Project description

Fieldsets with inlines

Mix inlines and fieldsets in any order in Django admin.

What is it?

Django administration has nice feature to render related models as inlines under the fieldsets out of the box. Unfortunately there is no easy way to render inlines between fieldsets.

But when the size of the model becomes bigger, ordering of fieldsets and related inlines becomes critical for the usability.

This package makes it easy to mix fieldsets and inlines in any order you want with minimal changes required to your existing code.

Requirements

  • Python: 3.4+
  • Django: 2.0+

Installation

pip install django-fieldsets-with-inlines

Add fieldsets_with_inlines to your INSTALLED_APPS Django settings.py:

INSTALLED_APPS = [
    ...
    'fieldsets_with_inlines',
    ...
]

Usage

In your admin.py import FieldsetsInlineMixin, rename fieldsets property to fieldsets_with_inlines and list inlines right between your fieldsets. You could also remove inlines property:

from fieldsets_with_inlines import FieldsetsInlineMixin

...

class TestAdmin(FieldsetsInlineMixin, admin.ModelAdmin):
    fieldsets_with_inlines = [
        ('Objekt', {
            'fields': [
                ('ID_RNO', 'id', 'kljuc', 'slug'),
                'naziv',
                'kategorija']}),
        LastnistvoInline,
        ('Kontaktni podatki', {
            'fields': [
                ('kontaktna_oseba', 'email', 'poslji_obvestila')]}),
        KontaktInline,
        ('Dostop', {
            'fields': [
                'users',
                ('cas_vpisa', 'zadnja_sprememba', 'cas_zadnje_posodobitve')]}),
        OdjavaInline
    ]

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_fieldsets_with_inlines-0.6.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_fieldsets_with_inlines-0.6.tar.gz.

File metadata

  • Download URL: django_fieldsets_with_inlines-0.6.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.0

File hashes

Hashes for django_fieldsets_with_inlines-0.6.tar.gz
Algorithm Hash digest
SHA256 dec73d0d91f238906c93a7b99c545167a8ab0cc98f8af202d01df0cfc32a71cb
MD5 3acd7005ca6b9325549b97e4b79310fa
BLAKE2b-256 1c71d4c5e0ac11afd144e4842598c706901dc5d66a62ab37f8a9c87b6b410c40

See more details on using hashes here.

File details

Details for the file django_fieldsets_with_inlines-0.6-py3-none-any.whl.

File metadata

  • Download URL: django_fieldsets_with_inlines-0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.0

File hashes

Hashes for django_fieldsets_with_inlines-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 26eb222ef96a009c6a9ef301c8c906d8314c557a9814fc8bdaaa0ac22728580d
MD5 8efc9da5f53d9ff1e751c4615cc75805
BLAKE2b-256 0c75c9082217ee0fc6e7cad6a6393ef25ccea25bfc48a0e157e936543771e027

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