51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
from django.contrib import admin
|
|
|
|
# Register your models here.
|
|
from .models import Tobacco, TobaccoCategory, ClubhausEvent, EventDate, EventDateVotes, VotingUser
|
|
|
|
|
|
@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",)
|
|
|
|
|
|
@admin.register(VotingUser)
|
|
class VotingUserAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "name", "modify_key")
|
|
ordering = ("id",)
|
|
|
|
|
|
@admin.register(EventDateVotes)
|
|
class EventDateVotesAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "voter", "date")
|
|
ordering = ("id",)
|
|
|
|
|
|
class EventDateInline(admin.StackedInline):
|
|
model = EventDate
|
|
extra = 0
|
|
|
|
|
|
@admin.register(ClubhausEvent)
|
|
class ClubhausEventAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "name", "date", "active")
|
|
list_editable = ('active',)
|
|
ordering = ("date",)
|
|
inlines = [
|
|
EventDateInline
|
|
]
|