Skip to content

DjangoAdminHackers/selective-inline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stories in Ready django-selective-inline

This is a small app for creating nice inlines in django admin:

Alt text

Installing

You may install it via pip or clone all repository:

pip install git+https://github.com/DjangoAdminHackers/selective-inline.git

Also you need to add selinline to your INSTALLED_APPS list

Usage

The app provides one more inline class which supports all admin inline options and more.

So admin.py example file:

from django.contrib import admin
from django.contrib.admin.options import InlineModelAdmin
from selinline.admin import SelectiveInlineMixin
from .models import Author, Book

class BookAdminInline(SelectiveInlineMixin, InlineModelAdmin):
    orderable_field = 'order_num'  # this option is required only for "ordering" feature
    model = Book
    extra = 1

class AuthorAdmin(admin.ModelAdmin):
    inlines = (BookAdminInline, )

admin.site.register(Author, AuthorAdmin)

You may check out complete test project in the "example" project folder

Ordering records

django-selective-inlines supports ordering inline records via drag-n-drop. For that you need to have some integer field in your model for storing order number value. So just set orderable_field property equals to that field name inside your inline class like in example above and that's it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published