Skip to content
Snippets Groups Projects
Verified Commit 3bb27f79 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add admin for Radio Settings

parent f99505f5
No related branches found
No related tags found
No related merge requests found
from django_json_widget.widgets import JSONEditorWidget
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.db.models import JSONField
from program.models import (
Category,
FundingCategory,
......@@ -9,6 +12,7 @@ from program.models import (
License,
LinkType,
MusicFocus,
RadioSettings,
RRule,
Topic,
Type,
......@@ -95,3 +99,25 @@ class UserProfileUserAdmin(UserAdmin):
admin.site.unregister(User)
admin.site.register(User, UserProfileUserAdmin)
@admin.register(RadioSettings)
class RadioSettingsAdmin(admin.ModelAdmin):
fieldsets = [
(None, {"fields": ["station_name", "station_website", "station_logo"]}),
("Fallback", {"fields": ["fallback_show"]}),
("CBA", {"fields": ["cba_api_key", "cba_domains"]}),
("Playout", {"fields": ["playout_channels"]}),
]
formfield_overrides = {
JSONField: {
"widget": JSONEditorWidget(
height=200,
options={
"enableSort": False,
"enableTransform": False,
"modes": ["code"],
},
)
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment