62 lines
1.4 KiB
Python
62 lines
1.4 KiB
Python
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
|
|
from .forms import CustomUserCreationForm
|
|
from .models import (
|
|
SEI,
|
|
Action,
|
|
Dosage,
|
|
Drug,
|
|
Effect,
|
|
Entry,
|
|
Experience,
|
|
ExperienceDose,
|
|
Favourite,
|
|
NotificationSettings,
|
|
Source,
|
|
Timing,
|
|
User,
|
|
)
|
|
|
|
|
|
# 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)
|
|
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)
|
|
admin.site.register(Favourite)
|