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


Release history Release notifications | RSS feed

This version

0.1

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

Uploaded Source

Built Distribution

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

django_fieldsets_inlines_jat-0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file django_fieldsets_inlines_jat-0.1.tar.gz.

File metadata

File hashes

Hashes for django_fieldsets_inlines_jat-0.1.tar.gz
Algorithm Hash digest
SHA256 af979391fd0101ca10fb876de9277c405dc2094dc5c902f8caae46f2f8c98b15
MD5 ba2c0fc159930ca6ec83e16c2db9de5c
BLAKE2b-256 4935dd851c525bd8f4770a63600190d61a9710fcecbeb1a5dbb9aafe1878352d

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_fieldsets_inlines_jat-0.1.tar.gz:

Publisher: python-publish.yml on javware/django-fieldsets-inlines-jat

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_fieldsets_inlines_jat-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_fieldsets_inlines_jat-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f050ee0a982bb90878bded3cfefe60ac7aea1fa0019b10b9350bd9cc104a46a
MD5 956662efda41cbfef5644448c7a0b1fb
BLAKE2b-256 69c65bf87c260e425342bebce8f7c0bd3f856d0523d40effdcef9d15fbf426b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_fieldsets_inlines_jat-0.1-py3-none-any.whl:

Publisher: python-publish.yml on javware/django-fieldsets-inlines-jat

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