mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 05:51:08 -05:00
- Add complete backend/ directory with full Django application - Add frontend/ directory with Vite + TypeScript setup ready for Next.js - Add comprehensive shared/ directory with: - Complete documentation and memory-bank archives - Media files and avatars (letters, park/ride images) - Deployment scripts and automation tools - Shared types and utilities - Add architecture/ directory with migration guides - Configure pnpm workspace for monorepo development - Update .gitignore to exclude .django_tailwind_cli/ build artifacts - Preserve all historical documentation in shared/docs/memory-bank/ - Set up proper structure for full-stack development with shared resources
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
from django.contrib import admin
|
|
from django.contrib.sites.models import Site
|
|
from .models import EmailConfiguration
|
|
|
|
|
|
@admin.register(EmailConfiguration)
|
|
class EmailConfigurationAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"site",
|
|
"from_name",
|
|
"from_email",
|
|
"reply_to",
|
|
"updated_at",
|
|
)
|
|
list_select_related = ("site",)
|
|
search_fields = ("site__domain", "from_name", "from_email", "reply_to")
|
|
readonly_fields = ("created_at", "updated_at")
|
|
fieldsets = (
|
|
(None, {"fields": ("site",)}),
|
|
(
|
|
"Email Settings",
|
|
{
|
|
"fields": ("api_key", ("from_name", "from_email"), "reply_to"),
|
|
"description": 'Configure the email settings. The From field in emails will appear as "From Name <from@email.com>"',
|
|
},
|
|
),
|
|
(
|
|
"Timestamps",
|
|
{"fields": ("created_at", "updated_at"), "classes": ("collapse",)},
|
|
),
|
|
)
|
|
|
|
def get_queryset(self, request):
|
|
return super().get_queryset(request).select_related("site")
|
|
|
|
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
|
if db_field.name == "site":
|
|
kwargs["queryset"] = Site.objects.all().order_by("domain")
|
|
return super().formfield_for_foreignkey(db_field, request, **kwargs)
|