nested inline is shit
This commit is contained in:
parent
0c83c0cfe8
commit
12f0314b76
1 changed files with 4 additions and 6 deletions
|
@ -1,5 +1,3 @@
|
||||||
from nested_admin import NestedStackedInline, NestedModelAdmin
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
from adminsortable2.admin import SortableAdminMixin
|
from adminsortable2.admin import SortableAdminMixin
|
||||||
|
@ -19,7 +17,7 @@ from .models import (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PlanInline(NestedStackedInline):
|
class PlanInline(admin.StackedInline):
|
||||||
model = Plan
|
model = Plan
|
||||||
extra = 1
|
extra = 1
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
|
@ -34,7 +32,7 @@ class ExternalLinkOfferingInline(admin.TabularInline):
|
||||||
ordering = ("order", "description")
|
ordering = ("order", "description")
|
||||||
|
|
||||||
|
|
||||||
class OfferingInline(NestedStackedInline):
|
class OfferingInline(admin.StackedInline):
|
||||||
model = ServiceOffering
|
model = ServiceOffering
|
||||||
extra = 1
|
extra = 1
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
|
@ -50,7 +48,7 @@ class OfferingInline(NestedStackedInline):
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
inlines = [PlanInline]
|
show_change_link = True
|
||||||
|
|
||||||
|
|
||||||
@admin.register(ReusableText)
|
@admin.register(ReusableText)
|
||||||
|
@ -70,7 +68,7 @@ class CategoryAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
@admin.register(CloudProvider)
|
@admin.register(CloudProvider)
|
||||||
class CloudProviderAdmin(NestedModelAdmin):
|
class CloudProviderAdmin(admin.ModelAdmin):
|
||||||
list_display = ("name", "slug", "logo_preview")
|
list_display = ("name", "slug", "logo_preview")
|
||||||
search_fields = ("name", "description")
|
search_fields = ("name", "description")
|
||||||
prepopulated_fields = {"slug": ("name",)}
|
prepopulated_fields = {"slug": ("name",)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue