File: admin.py

package info (click to toggle)
django-ajax-selects 1.7.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 356 kB
  • sloc: python: 924; javascript: 191; makefile: 4
file content (30 lines) | stat: -rw-r--r-- 556 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

from django.contrib import admin
from ajax_select.admin import AjaxSelectAdmin, AjaxSelectAdminTabularInline
from tests.models import Author, Book, Person
from tests.test_integration import BookForm


@admin.register(Book)
class BookAdmin(AjaxSelectAdmin):
    form = BookForm


class BookInline(AjaxSelectAdminTabularInline):

    model = Book
    form = BookForm
    extra = 2


@admin.register(Author)
class AuthorAdmin(AjaxSelectAdmin):

    inlines = [
        BookInline
    ]


@admin.register(Person)
class PersonAdmin(admin.ModelAdmin):
    pass