浏览代码

Prefetch generic content objects for promotions

master
Asia Biega 13 年前
父节点
当前提交
fe8b533f3e
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1
    0
      oscar/apps/promotions/context_processors.py

+ 1
- 0
oscar/apps/promotions/context_processors.py 查看文件

@@ -25,6 +25,7 @@ def get_request_promotions(request):
25 25
     Return promotions relevant to this request
26 26
     """
27 27
     promotions = PagePromotion._default_manager.select_related() \
28
+                                               .prefetch_related('content_object') \
28 29
                                                .filter(page_url=request.path) \
29 30
                                                .order_by('display_order')
30 31
 

正在加载...
取消
保存