subscription/views.py
- PlansListView: served from cache (subscription:plans:v1, 1h TTL);
plans change ~never and the list is read on every subscription screen.
subscription/receivers.py (new)
- post_save/post_delete on Plan -> cache.delete(PLANS_CACHE_KEY).
subscription/apps.py
- SubscriptionConfig.ready() imports receivers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
10 lines
270 B
Python
10 lines
270 B
Python
from django.apps import AppConfig
|
|
|
|
|
|
class SubscriptionConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'subscription'
|
|
|
|
def ready(self):
|
|
from . import receivers # noqa: F401 (باطلکردنِ کشِ پلنها)
|