mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
24 lines
835 B
Python
24 lines
835 B
Python
from django.contrib import admin
|
|
from pricemon.models import PriceAlert, PriceSnapshot, PriceWatcher
|
|
|
|
|
|
@admin.register(PriceWatcher)
|
|
class PriceWatcherAdmin(admin.ModelAdmin):
|
|
list_display = ['name', 'url', 'last_price', 'last_checked_at', 'enabled', 'check_interval_hours']
|
|
list_filter = ['enabled', 'check_interval_hours']
|
|
search_fields = ['name', 'url']
|
|
|
|
|
|
@admin.register(PriceSnapshot)
|
|
class PriceSnapshotAdmin(admin.ModelAdmin):
|
|
list_display = ['watcher', 'price', 'raw_text', 'error', 'checked_at']
|
|
list_filter = ['watcher']
|
|
readonly_fields = ['checked_at']
|
|
|
|
|
|
@admin.register(PriceAlert)
|
|
class PriceAlertAdmin(admin.ModelAdmin):
|
|
list_display = ['watcher', 'old_price', 'new_price', 'drop_pct', 'dismissed', 'created_at']
|
|
list_filter = ['dismissed', 'watcher']
|
|
readonly_fields = ['created_at']
|