2022-08-19 10:35:05 +00:00
|
|
|
from django.contrib import admin
|
2022-08-24 01:35:16 +00:00
|
|
|
import nested_admin
|
2022-08-19 10:35:05 +00:00
|
|
|
|
2022-08-22 02:01:56 +00:00
|
|
|
from frog_api.models import Category, Entry, Measure, Project, Version
|
2022-08-19 10:35:05 +00:00
|
|
|
|
2022-08-24 01:35:16 +00:00
|
|
|
|
|
|
|
class CategoryInline(nested_admin.NestedStackedInline):
|
|
|
|
model = Category
|
|
|
|
extra = 0
|
|
|
|
|
|
|
|
|
|
|
|
class VersionInline(nested_admin.NestedStackedInline):
|
|
|
|
model = Version
|
|
|
|
inlines = [CategoryInline]
|
|
|
|
extra = 0
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectAdmin(nested_admin.NestedModelAdmin):
|
|
|
|
model = Project
|
|
|
|
inlines = [VersionInline]
|
|
|
|
extra = 0
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(Project, ProjectAdmin)
|
2022-08-20 03:33:23 +00:00
|
|
|
admin.site.register(Entry)
|
2022-08-22 02:01:56 +00:00
|
|
|
admin.site.register(Measure)
|