drugs/core/admin.py

60 lines
1.3 KiB
Python
Raw Normal View History

2023-10-17 20:00:25 +00:00
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm
2024-01-01 18:21:27 +00:00
from .models import (
SEI,
Action,
Dosage,
Drug,
Effect,
Entry,
Experience,
ExperienceDose,
NotificationSettings,
Source,
Timing,
User,
)
2023-10-17 20:00:25 +00:00
# Register your models here.
class CustomUserAdmin(UserAdmin):
# list_filter = ["plans"]
model = User
add_form = CustomUserCreationForm
fieldsets = (
*UserAdmin.fieldsets,
(
"Billing information",
{"fields": ("billing_provider_id", "customer_id", "stripe_id")},
),
# (
# "Payment information",
# {
# "fields": (
# # "plans",
# "last_payment",
# )
# },
# ),
)
class NotificationSettingsAdmin(admin.ModelAdmin):
list_display = ("user", "ntfy_topic", "ntfy_url")
admin.site.register(User, CustomUserAdmin)
admin.site.register(NotificationSettings, NotificationSettingsAdmin)
2024-01-01 18:21:27 +00:00
admin.site.register(Drug)
admin.site.register(Entry)
admin.site.register(Dosage)
admin.site.register(Timing)
admin.site.register(Effect)
admin.site.register(Action)
admin.site.register(Experience)
admin.site.register(Source)
admin.site.register(SEI)
admin.site.register(ExperienceDose)