inital commit
This commit is contained in:
32
adventrues/admin.py
Normal file
32
adventrues/admin.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import AdventureCategory, AdventureImage, AdventureOffering
|
||||
|
||||
|
||||
class AdventureImageInline(admin.TabularInline):
|
||||
model = AdventureImage
|
||||
extra = 0
|
||||
|
||||
|
||||
@admin.register(AdventureCategory)
|
||||
class AdventureCategoryAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "slug")
|
||||
search_fields = ("name", "slug")
|
||||
|
||||
|
||||
@admin.register(AdventureOffering)
|
||||
class AdventureOfferingAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
"title",
|
||||
"public_id",
|
||||
"vendor",
|
||||
"category",
|
||||
"duration_minutes",
|
||||
"capacity",
|
||||
"price_per_person",
|
||||
"is_active",
|
||||
)
|
||||
list_filter = ("is_active", "category", "vendor")
|
||||
search_fields = ("title", "public_id", "vendor__business_name")
|
||||
readonly_fields = ("created_at", "updated_at")
|
||||
inlines = [AdventureImageInline]
|
||||
Reference in New Issue
Block a user