firma_backend products and contact section datas
This commit is contained in:
21
content/admin.py
Normal file
21
content/admin.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.contrib import admin
|
||||
from .models import Product, ProductFeature, ContactMessage
|
||||
|
||||
# ========== INLINE for Product Features ==========
|
||||
class ProductFeatureInline(admin.TabularInline):
|
||||
model = ProductFeature
|
||||
extra = 1
|
||||
|
||||
|
||||
# ========== PRODUCT ADMIN ==========
|
||||
@admin.register(Product)
|
||||
class ProductAdmin(admin.ModelAdmin):
|
||||
list_display = ('name',)
|
||||
inlines = [ProductFeatureInline]
|
||||
|
||||
|
||||
# ========== CONTACT MESSAGE ADMIN ==========
|
||||
@admin.register(ContactMessage)
|
||||
class ContactAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'phone', 'product_name', 'created_at')
|
||||
search_fields = ('name', 'phone', 'product_name')
|
||||
Reference in New Issue
Block a user