22 lines
644 B
Python
22 lines
644 B
Python
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')
|