Browse Source

Prefetch generic content objects for promotions

master
Asia Biega 13 years ago
parent
commit
fe8b533f3e
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      oscar/apps/promotions/context_processors.py

+ 1
- 0
oscar/apps/promotions/context_processors.py View File

25
     Return promotions relevant to this request
25
     Return promotions relevant to this request
26
     """
26
     """
27
     promotions = PagePromotion._default_manager.select_related() \
27
     promotions = PagePromotion._default_manager.select_related() \
28
+                                               .prefetch_related('content_object') \
28
                                                .filter(page_url=request.path) \
29
                                                .filter(page_url=request.path) \
29
                                                .order_by('display_order')
30
                                                .order_by('display_order')
30
 
31
 

Loading…
Cancel
Save