Ticket #26115: admin.py
File admin.py, 442 bytes (added by , 9 years ago) |
---|
Line | |
---|---|
1 | from django.contrib import admin |
2 | from .models import Employee, EmployeeTitle, Title |
3 | |
4 | # Register your models here. |
5 | class EmployeeTitleInline(admin.TabularInline): |
6 | model = EmployeeTitle |
7 | extra = 0 |
8 | |
9 | @admin.register(Employee) |
10 | class EmployeeAdmin(admin.ModelAdmin): |
11 | inlines = (EmployeeTitleInline,) |
12 | list_display = ( |
13 | 'name', |
14 | 'current_title', |
15 | ) |
16 | |
17 | @admin.register(Title) |
18 | class TitleAdmin(admin.ModelAdmin): |
19 | pass |