mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
commit
fc6a73d8e5
2 changed files with 2 additions and 9 deletions
|
|
@ -4,7 +4,6 @@ from django.contrib.admin.views.main import ChangeList
|
|||
from django.http import HttpResponseRedirect
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.admin.options import IncorrectLookupParameters
|
||||
from django import template
|
||||
from django.shortcuts import render_to_response
|
||||
|
||||
import django
|
||||
|
|
@ -253,15 +252,11 @@ class TreeEditor(admin.ModelAdmin):
|
|||
'selection_note_all': selection_note_all % {'total_count': cl.result_count},
|
||||
})
|
||||
context.update(extra_context or {})
|
||||
context_instance = template.RequestContext(
|
||||
request,
|
||||
context
|
||||
)
|
||||
return render_to_response(self.change_list_template or [
|
||||
'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
|
||||
'admin/%s/change_list.html' % app_label,
|
||||
'admin/change_list.html'
|
||||
], context=context_instance.flatten())
|
||||
], context=context)
|
||||
|
||||
def changelist_view(self, request, extra_context=None, *args, **kwargs):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from django.shortcuts import get_object_or_404
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.template import RequestContext
|
||||
from django.http import HttpResponse, Http404
|
||||
from django.template.loader import select_template
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
|
@ -37,8 +36,7 @@ def category_detail(request, path, template_name='categories/category_detail.htm
|
|||
path_items.pop()
|
||||
templates.append(template_name)
|
||||
|
||||
context = RequestContext(request)
|
||||
context.update({'category': category})
|
||||
context = {'category': category}
|
||||
if extra_context:
|
||||
context.update(extra_context)
|
||||
return HttpResponse(select_template(templates).render(context))
|
||||
|
|
|
|||
Loading…
Reference in a new issue