|
|
|
@ -1,21 +1,22 @@
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
from .models import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def assign_random_shifts(modeladmin, request, queryset):
|
|
|
|
|
for member in queryset:
|
|
|
|
|
member.assign_random_shifts()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Register your models here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FallbackAssignmentInline(admin.TabularInline):
|
|
|
|
|
model = FallbackAssignment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(TeamMember)
|
|
|
|
|
class TeamMemberAdmin(admin.ModelAdmin):
|
|
|
|
|
fields = ["name"]
|
|
|
|
|
list_display = ["name"]
|
|
|
|
|
inlines = (FallbackAssignmentInline,)
|
|
|
|
|
actions = (assign_random_shifts,)
|
|
|
|
|
|
|
|
|
|