mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:51:09 -05:00
18 lines
733 B
Python
18 lines
733 B
Python
from django.contrib import admin
|
|
from simple_history.admin import SimpleHistoryAdmin
|
|
from .models import Company, Manufacturer
|
|
|
|
@admin.register(Company)
|
|
class CompanyAdmin(SimpleHistoryAdmin):
|
|
list_display = ('id', 'name', 'headquarters', 'website', 'created_at')
|
|
search_fields = ('name', 'headquarters', 'description')
|
|
prepopulated_fields = {'slug': ('name',)}
|
|
readonly_fields = ('created_at', 'updated_at')
|
|
|
|
@admin.register(Manufacturer)
|
|
class ManufacturerAdmin(SimpleHistoryAdmin):
|
|
list_display = ('id', 'name', 'headquarters', 'website', 'created_at')
|
|
search_fields = ('name', 'headquarters', 'description')
|
|
prepopulated_fields = {'slug': ('name',)}
|
|
readonly_fields = ('created_at', 'updated_at')
|