Initial commit from ZIP
This commit is contained in:
commit
378d4692a9
454 files changed
+40367
No files matched your search
Executable
+18
@@ -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"
|
||||
Reference in new issue
Block a user