77 lines
2.2 KiB
Python
Executable File
77 lines
2.2 KiB
Python
Executable File
from django.contrib import admin
|
|
|
|
from .models import (
|
|
BlogPost,
|
|
ContactSubmission,
|
|
Founder,
|
|
JobApplication,
|
|
JobOpening,
|
|
NewsletterSignup,
|
|
Product,
|
|
)
|
|
|
|
|
|
@admin.register(Product)
|
|
class ProductAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "category", "is_published", "sort_order", "updated_at")
|
|
list_filter = ("category", "is_published")
|
|
search_fields = ("name", "tagline", "slug")
|
|
prepopulated_fields = {"slug": ("name",)}
|
|
|
|
|
|
@admin.register(Founder)
|
|
class FounderAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "role", "is_published", "sort_order")
|
|
list_filter = ("is_published",)
|
|
search_fields = ("name", "role")
|
|
|
|
|
|
@admin.register(BlogPost)
|
|
class BlogPostAdmin(admin.ModelAdmin):
|
|
list_display = ("title", "category", "author_name", "is_published", "published_at")
|
|
list_filter = ("category", "is_published")
|
|
search_fields = ("title", "excerpt", "body")
|
|
prepopulated_fields = {"slug": ("title",)}
|
|
date_hierarchy = "published_at"
|
|
|
|
|
|
@admin.register(JobOpening)
|
|
class JobOpeningAdmin(admin.ModelAdmin):
|
|
list_display = ("title", "location", "employment_type", "is_open", "posted_at")
|
|
list_filter = ("location", "is_open")
|
|
search_fields = ("title", "description")
|
|
prepopulated_fields = {"slug": ("title",)}
|
|
|
|
|
|
@admin.register(ContactSubmission)
|
|
class ContactSubmissionAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "email", "interest", "company", "created_at")
|
|
list_filter = ("interest", "created_at")
|
|
search_fields = ("name", "email", "company", "message")
|
|
readonly_fields = (
|
|
"name",
|
|
"email",
|
|
"company",
|
|
"role",
|
|
"country",
|
|
"interest",
|
|
"message",
|
|
"referrer",
|
|
"user_agent",
|
|
"ip_address",
|
|
"created_at",
|
|
)
|
|
|
|
|
|
@admin.register(NewsletterSignup)
|
|
class NewsletterSignupAdmin(admin.ModelAdmin):
|
|
list_display = ("email", "source", "confirmed", "created_at")
|
|
list_filter = ("source", "confirmed")
|
|
search_fields = ("email",)
|
|
|
|
|
|
@admin.register(JobApplication)
|
|
class JobApplicationAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "email", "role_applied_for", "created_at")
|
|
search_fields = ("name", "email", "role_applied_for")
|