mirror of
https://github.com/wahyd4/links.git
synced 2026-08-09 05:06:16 +10:00
32 lines
915 B
Python
32 lines
915 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',
|
|
'initial_price',
|
|
'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']
|