1
0
clubhaus-schornbach/clubhaus/homepage/admin.py

66 lines
1.6 KiB
Python
Raw Normal View History

from django.contrib import admin
# Register your models here.
2023-07-24 20:26:54 +02:00
from .models import Tobacco, TobaccoCategory, ClubhausEvent, EventDate, EventDateVote, VotingUser, Setting, \
EventBackground
@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",)
2022-08-03 02:07:44 +02:00
@admin.register(VotingUser)
class VotingUserAdmin(admin.ModelAdmin):
list_display = ("id", "name", "modify_key")
ordering = ("id",)
2022-09-04 00:37:02 +02:00
@admin.register(EventDateVote)
class EventDateVotesAdmin(admin.ModelAdmin):
list_display = ("id", "voter", "date", "available")
list_editable = ('available',)
ordering = ("id",)
class EventDateInline(admin.StackedInline):
model = EventDate
extra = 0
@admin.register(ClubhausEvent)
class ClubhausEventAdmin(admin.ModelAdmin):
list_display = ("id", "name", "date", "active", "voting_locked")
list_editable = ('active', "voting_locked")
ordering = ("date",)
inlines = [
EventDateInline
]
2022-09-04 00:37:02 +02:00
2023-07-24 20:26:54 +02:00
@admin.register(EventBackground)
class EventBackgroundAdmin(admin.ModelAdmin):
list_display = ("id", "name", "picture")
ordering = ("id",)
2022-09-04 00:37:02 +02:00
@admin.register(Setting)
class SettingAdmin(admin.ModelAdmin):
list_display = ("name", "active")
ordering = ("active", "id")
list_editable = ("active",)