Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Don't forget to add admin.py for the exercises application

Roland Geider4656d24366d3
diff --git a/exercises/admin.py b/exercises/admin.py
new file mode 100644
index 000000000..5f5611ff8
--- /dev/null
+++ b/exercises/admin.py
@@ -0,0 +1,30 @@
+# This file is part of Workout Manager.
+#
+# Workout Manager is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Workout Manager is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+
+from exercises.models import Language, Exercise, ExerciseComment, ExerciseCategory
+
+from django.contrib import admin
+class ExerciseCommentInline(admin.TabularInline): #admin.StackedInline
+ model = ExerciseComment
+ extra = 1
+
+class ExerciseAdmin(admin.ModelAdmin):
+ #fields = ['name',]
+
+ inlines = [ExerciseCommentInline]
+
+admin.site.register(Exercise, ExerciseAdmin)
+admin.site.register(ExerciseCategory)
+admin.site.register(Language)
+