Initial commit from ZIP

This commit is contained in:
kusz committed 2024-11-27 13:18:16 +01:00
commit 378d4692a9
454 files changed
+40367

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
from nested_admin.nested import NestedTabularInline
from polymorphic.admin import (
PolymorphicParentModelAdmin as BasePolymorphicParentModelAdmin,
)
class PolymorphicParentModelAdmin(BasePolymorphicParentModelAdmin):
def get_child_type_choices(self, request, action):
choices = super().get_child_type_choices(request=request, action=action)
return tuple((ct_id, label.title()) for (ct_id, label) in choices)
class NestedTabularSingleItemInline(NestedTabularInline):
template = "nesting/admin/inlines/tabular_single.html"
class NestedStackedSingleItemInline(NestedTabularInline):
template = "nesting/admin/inlines/stacked_single.html"