add external links
This commit is contained in:
parent
7b21d9d612
commit
8ed39690f1
5 changed files with 98 additions and 1 deletions
|
@ -8,6 +8,7 @@ from .models import (
|
|||
Currency,
|
||||
Plan,
|
||||
PlanPrice,
|
||||
ExternalLink,
|
||||
)
|
||||
|
||||
|
||||
|
@ -33,6 +34,13 @@ class PlanInline(admin.StackedInline):
|
|||
return formset
|
||||
|
||||
|
||||
class ExternalLinkInline(admin.TabularInline):
|
||||
model = ExternalLink
|
||||
extra = 1
|
||||
fields = ("description", "url", "order")
|
||||
ordering = ("order", "description")
|
||||
|
||||
|
||||
@admin.register(Category)
|
||||
class CategoryAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "slug", "parent", "order")
|
||||
|
@ -73,7 +81,7 @@ class ServiceAdmin(admin.ModelAdmin):
|
|||
filter_horizontal = ("categories", "consulting_partners")
|
||||
search_fields = ("name", "description", "slug")
|
||||
prepopulated_fields = {"slug": ("name",)}
|
||||
inlines = [PlanInline]
|
||||
inlines = [PlanInline, ExternalLinkInline]
|
||||
|
||||
def logo_preview(self, obj):
|
||||
if obj.logo:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue