38 lines
870 B
Python
38 lines
870 B
Python
from django.contrib import admin
|
|
|
|
# Register your models here.
|
|
from .models import Tobacco, TobaccoCategory, ClubhausEvent, EventDate
|
|
|
|
|
|
@admin.register(Tobacco)
|
|
class TobaccoAdmin(admin.ModelAdmin):
|
|
list_display = ('name', 'description', 'category', 'in_stock')
|
|
list_editable = ('in_stock',)
|
|
ordering = ('name',)
|
|
|
|
|
|
@admin.register(TobaccoCategory)
|
|
class TobaccoCategoryAdmin(admin.ModelAdmin):
|
|
list_display = ('id', 'name')
|
|
ordering = ('id',)
|
|
|
|
|
|
@admin.register(EventDate)
|
|
class EventDateAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "event", "date")
|
|
ordering = ("id",)
|
|
|
|
|
|
class EventDateInline(admin.StackedInline):
|
|
model = EventDate
|
|
extra = 0
|
|
|
|
|
|
@admin.register(ClubhausEvent)
|
|
class ClubhausEventAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "name", "date")
|
|
ordering = ("date",)
|
|
inlines = [
|
|
EventDateInline
|
|
]
|