Beispiel #1
0
 def repopulate_cache(self, request, queryset):
     for template in queryset:
         add_template_to_cache(template)
     message = ungettext(
         "Cache successfully repopulated with one template.",
         "Cache successfully repopulated with %(count)d templates.",
         len(queryset))
     self.message_user(request, message % {'count': len(queryset)})
Beispiel #2
0
 def repopulate_cache(self, request, queryset):
     for template in queryset:
         add_template_to_cache(template)
     count = queryset.count()
     message = ungettext(
         "Cache successfully repopulated with one template.",
         "Cache successfully repopulated with %(count)d templates.", count)
     self.message_user(request, message % {'count': count})
Beispiel #3
0
 def repopulate_cache(self, request, queryset):
     if not backend:
         self.message_user(request, ("There is no active cache backend."))
         return
     for template in queryset:
         add_template_to_cache(template)
     message = ungettext(
         "Cache successfully repopulated with one template.",
         "Cache successfully repopulated with %(count)d templates.",
         len(queryset))
     self.message_user(request, message % {'count': len(queryset)})