mirror of
https://github.com/jazzband/django-categories.git
synced 2026-05-05 06:04:47 +00:00
Test Cases fix
This commit is contained in:
parent
e39b5d24a8
commit
1dc6d473ff
1 changed files with 12 additions and 11 deletions
|
|
@ -148,20 +148,20 @@ class TreeEditor(admin.ModelAdmin):
|
|||
self.list_display_links, self.list_filter, self.date_hierarchy,
|
||||
self.search_fields, self.list_select_related,
|
||||
self.list_per_page, self.list_editable, self)
|
||||
elif django.VERSION[0] >= 2:
|
||||
params = (
|
||||
request, self.model, list_display,
|
||||
self.list_display_links, self.list_filter, self.date_hierarchy,
|
||||
self.search_fields, self.list_select_related,
|
||||
self.list_per_page, self.list_max_show_all,
|
||||
self.list_editable, self, self.sortable_by)
|
||||
else:
|
||||
elif django.VERSION[0] == 1 or ( django.VERSION[0] == 2 and django.VERSION[1] < 1):
|
||||
params = (
|
||||
request, self.model, list_display,
|
||||
self.list_display_links, self.list_filter, self.date_hierarchy,
|
||||
self.search_fields, self.list_select_related,
|
||||
self.list_per_page, self.list_max_show_all,
|
||||
self.list_editable, self)
|
||||
else:
|
||||
params = (
|
||||
request, self.model, list_display,
|
||||
self.list_display_links, self.list_filter, self.date_hierarchy,
|
||||
self.search_fields, self.list_select_related,
|
||||
self.list_per_page, self.list_max_show_all,
|
||||
self.list_editable, self, self.sortable_by)
|
||||
cl = TreeChangeList(*params)
|
||||
except IncorrectLookupParameters:
|
||||
# Wacky lookup parameters were given, so redirect to the main
|
||||
|
|
@ -250,9 +250,7 @@ class TreeEditor(admin.ModelAdmin):
|
|||
}
|
||||
if django.VERSION[0] == 1 and django.VERSION[1] < 4:
|
||||
context['root_path'] = self.admin_site.root_path
|
||||
elif django.VERSION[0] >= 2:
|
||||
context['opts'] = self.model._meta
|
||||
else:
|
||||
elif django.VERSION[0] == 1 or ( django.VERSION[0] == 2 and django.VERSION[1] < 1):
|
||||
selection_note_all = ungettext('%(total_count)s selected', 'All %(total_count)s selected', cl.result_count)
|
||||
|
||||
context.update({
|
||||
|
|
@ -260,6 +258,9 @@ class TreeEditor(admin.ModelAdmin):
|
|||
'selection_note': _('0 of %(cnt)s selected') % {'cnt': len(cl.result_list)},
|
||||
'selection_note_all': selection_note_all % {'total_count': cl.result_count},
|
||||
})
|
||||
else:
|
||||
context['opts'] = self.model._meta
|
||||
|
||||
context.update(extra_context or {})
|
||||
return render_to_response(self.change_list_template or [
|
||||
'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
|
||||
|
|
|
|||
Loading…
Reference in a new issue