X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/55a07da1814663143cc32628edad0b4f4edb752d..93249b4cb9fec0fc8e0d2fd2eff669e9f3704033:/contrib/sobol/admin.py?ds=sidebyside diff --git a/contrib/sobol/admin.py b/contrib/sobol/admin.py index 1ebbf5e..87dd39a 100644 --- a/contrib/sobol/admin.py +++ b/contrib/sobol/admin.py @@ -6,9 +6,10 @@ from django.db.models import Count from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.template import RequestContext -from django.utils.functional import update_wrapper +from django.utils.translation import ugettext_lazy as _ from philo.admin import EntityAdmin from philo.contrib.sobol.models import Search, ResultURL, SearchView +from functools import update_wrapper class ResultURLInline(admin.TabularInline): @@ -79,7 +80,13 @@ class SearchAdmin(admin.ModelAdmin): qs = self.queryset(request).filter(pk__in=object_ids) opts = self.model._meta + if len(object_ids) == 1: + title = _(u"Search results for %s" % qs[0]) + else: + title = _(u"Search results for multiple objects") + context = { + 'title': title, 'queryset': qs, 'opts': opts, 'root_path': self.admin_site.root_path,