Refactor card badge and multiselect template tags to properly implement and/or improve caching and context handling

- Updated `card_badge` and `card_multiselect` template tags to utilize `reverse_lazy` for URL resolution.
- Enhanced caching mechanisms in `card_badge.html` and `card_multiselect.html` to improve performance.
- Introduced a new template `_card_multiselect_options.html` for rendering multiselect options.
- Improved context management in `card_multiselect` to handle selected cards and dynamic placeholders.
- Added error handling for query hashing in `card_multiselect` to ensure robustness.
- Updated `trade_offer_tags` to optimize database queries using `select_related` for related objects.
This commit is contained in:
badblocks 2025-04-29 13:50:52 -07:00
parent 7d94dc001f
commit 4e50e1545c
10 changed files with 234 additions and 163 deletions

View file

@ -5,6 +5,5 @@ class TradesConfig(AppConfig):
name = "trades"
def ready(self):
# This import registers the signal handlers defined in trades/signals.py,
# ensuring that denormalized field updates occur whenever related objects change.
# Implicitly connect signal handlers decorated with @receiver.
import trades.signals