Skip to content

Commit

Permalink
show active & repeats in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ammar-faifi committed Nov 27, 2023
1 parent 348a422 commit 0aa54a1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions notifier/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@
from django.contrib import admin
from . import models

admin.site.register(
[
models.NotificationEvent,
models.Status,
models.Banner,
models.BannerEvent
admin.site.register([models.NotificationEvent, models.Status, models.BannerEvent])


def repeats(obj: models.Banner) -> str:
return abs(obj.scheduler.repeats) - 1


@admin.register(models.Banner)
class BannerAdmin(admin.ModelAdmin):
"""
Custom admin model site for `Banner` model.
"""

list_display = ["id", "user", "active", repeats]
list_filter = [
"active",
]
search_fields = [
"user__username",
]
)


@admin.register(models.TrackingList)
Expand Down

0 comments on commit 0aa54a1

Please sign in to comment.