feat(src): add ticketing REST API and admin UI for tickets, settings, and branding
Introduce DRF views for ticket creation, listing, updating, and commenting, integrate admin registrations for new models, and provide a demo data command to seed initial content. This enables full project management workflow within the backend.
This commit is contained in:
85 files changed
+8257
-145
No files matched your search
+29
-3
@@ -1,5 +1,31 @@
|
||||
"""generated with djinit"""
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
|
||||
|
||||
# Register your models here.
|
||||
from src.accounts.models import Setting, SiteBranding, User
|
||||
|
||||
|
||||
@admin.register(User)
|
||||
class UserAdmin(BaseUserAdmin):
|
||||
list_display = ("id", "email", "name", "is_staff", "is_active")
|
||||
search_fields = ("email", "name")
|
||||
ordering = ("email",)
|
||||
fieldsets = BaseUserAdmin.fieldsets + (
|
||||
("Extra", {"fields": ("google_id", "profile_image", "role")}),
|
||||
)
|
||||
|
||||
@admin.display(description="Name")
|
||||
def name(self, obj):
|
||||
return obj.get_full_name() or obj.username
|
||||
|
||||
|
||||
@admin.register(Setting)
|
||||
class SettingAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "user", "group", "key", "value")
|
||||
list_filter = ("group",)
|
||||
search_fields = ("key", "value", "user__email")
|
||||
|
||||
|
||||
@admin.register(SiteBranding)
|
||||
class SiteBrandingAdmin(admin.ModelAdmin):
|
||||
list_display = ("brand_name", "is_active", "created_at", "updated_at")
|
||||
list_editable = ("is_active",)
|
||||
Reference in new issue
Block a user