mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-01-02 01:47:04 -05:00
feat: Implement initial schema and add various API, service, and management command enhancements across the application.
This commit is contained in:
@@ -22,9 +22,7 @@ class ParksConfig(AppConfig):
|
||||
from apps.parks.models import Park
|
||||
|
||||
# Register FSM transitions for Park
|
||||
apply_state_machine(
|
||||
Park, field_name="status", choice_group="statuses", domain="parks"
|
||||
)
|
||||
apply_state_machine(Park, field_name="status", choice_group="statuses", domain="parks")
|
||||
|
||||
def _register_callbacks(self):
|
||||
"""Register FSM transition callbacks for park models."""
|
||||
@@ -42,31 +40,16 @@ class ParksConfig(AppConfig):
|
||||
from apps.parks.models import Park
|
||||
|
||||
# Cache invalidation for all park status changes
|
||||
register_callback(
|
||||
Park, 'status', '*', '*',
|
||||
ParkCacheInvalidation()
|
||||
)
|
||||
register_callback(Park, "status", "*", "*", ParkCacheInvalidation())
|
||||
|
||||
# API cache invalidation
|
||||
register_callback(
|
||||
Park, 'status', '*', '*',
|
||||
APICacheInvalidation(include_geo_cache=True)
|
||||
)
|
||||
register_callback(Park, "status", "*", "*", APICacheInvalidation(include_geo_cache=True))
|
||||
|
||||
# Search text update
|
||||
register_callback(
|
||||
Park, 'status', '*', '*',
|
||||
SearchTextUpdateCallback()
|
||||
)
|
||||
register_callback(Park, "status", "*", "*", SearchTextUpdateCallback())
|
||||
|
||||
# Notification for significant status changes
|
||||
register_callback(
|
||||
Park, 'status', '*', 'CLOSED_PERM',
|
||||
StatusChangeNotification(notify_admins=True)
|
||||
)
|
||||
register_callback(
|
||||
Park, 'status', '*', 'DEMOLISHED',
|
||||
StatusChangeNotification(notify_admins=True)
|
||||
)
|
||||
register_callback(Park, "status", "*", "CLOSED_PERM", StatusChangeNotification(notify_admins=True))
|
||||
register_callback(Park, "status", "*", "DEMOLISHED", StatusChangeNotification(notify_admins=True))
|
||||
|
||||
logger.debug("Registered park transition callbacks")
|
||||
|
||||
Reference in New Issue
Block a user