mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 14:11:09 -05:00
feat: complete monorepo structure with frontend and shared resources
- 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
This commit is contained in:
39
backend/apps/email_service/admin.py
Normal file
39
backend/apps/email_service/admin.py
Normal file
@@ -0,0 +1,39 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user