from django.contrib import admin
from .models import *
from exercise.models import Exercise

# Register your models here.
class WorkoutExerciseInline(admin.StackedInline):
    model = WorkoutExercise
    ordering = ("pk",)
    extra = 0

@admin.register(Workout)
class WorkoutAdmin(admin.ModelAdmin):
    list_display = ("name", "description", "registered_user", "created_at", "updated_at")
    inlines = [
        WorkoutExerciseInline,
    ]

@admin.register(WorkoutExercise)
class WorkoutExerciseAdmin(admin.ModelAdmin):
    list_display = ("workout", "exercise", "weight", "reps", "created_at", "updated_at")

@admin.register(CompletedWorkout)
class CompletedWorkoutAdmin(admin.ModelAdmin):
    list_display = ("registered_user", "workout", "workout_start_time", "difficulty", "notes", "total_time", "created_at",)
    