Commit b8a4f8d16dacbd5fc2512fa8e566e9324492a323

Authored by Claude Paroz
2 parents 4e0a2bef 1a053cf9

Merge pull request #60 from collinanderson/context.flatten

use context.flatten() now that 1.6 support is gone
... ... @@ -178,10 +178,7 @@ class RenderCommentFormNode(CommentFormNode):
178 178 "comments/%s/form.html" % ctype.app_label,
179 179 "comments/form.html"
180 180 ]
181   - # Django 1.6 does not have context.flatten().
182   - context_dict = {}
183   - for d in context.dicts:
184   - context_dict.update(d)
  181 + context_dict = context.flatten()
185 182 context_dict['form'] = self.get_form(context)
186 183 formstr = render_to_string(template_search_list, context_dict)
187 184 return formstr
... ... @@ -219,10 +216,7 @@ class RenderCommentListNode(CommentListNode):
219 216 "comments/list.html"
220 217 ]
221 218 qs = self.get_queryset(context)
222   - # Django 1.6 does not have context.flatten().
223   - context_dict = {}
224   - for d in context.dicts:
225   - context_dict.update(d)
  219 + context_dict = context.flatten()
226 220 context_dict['comment_list'] = self.get_context_value_from_queryset(context, qs)
227 221 liststr = render_to_string(template_search_list, context_dict)
228 222 return liststr
... ...
Please register or login to post a comment