-
Notifications
You must be signed in to change notification settings - Fork 1
/
group.py
42 lines (29 loc) · 755 Bytes
/
group.py
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
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
# django-mcadmin
# mcadmin/admin/group.py
from typing import List, Type, Sequence # pylint: disable=W0611
from django.contrib import admin
from mcadmin.models.command import Command
__all__ = ["GroupAdmin"] # type: List[str]
class CommandInline(admin.TabularInline):
"""
Command inline for GroupAdmin.
"""
model = Command
extra = 1
class GroupAdmin(admin.ModelAdmin):
"""
Customize Group model for admin area.
"""
list_display = [
"name",
] # type: List[str]
list_filter = [
"name",
] # type: List[str]
search_fields = [
"name",
] # type: List[str]
inlines = [
CommandInline,
] # type: Sequence[Type[CommandInline]]