class PreviewAdmin(admin.ModelAdmin): def admin_slide_preview(self, obj): return "
" % obj.id admin_slide_preview.allow_tags = True admin_slide_preview.short_description = 'Preview' def get_preview(self, request, object_id): sub = self.queryset(request)[0] template = "preview/%s.html" % sub.__class__.__name__ return object_detail(request, queryset=self.queryset(request), object_id=object_id, template_name=template.lower()) def get_urls(self): urls = super(PreviewAdmin, self).get_urls() my_urls = patterns('', (r'^(?P
Abstract: {{ object.abstract }} |
Author: {{ object.author }} Published: {{ object.published_date }} Category: {{ object.category }} Tags: {% for tag in object.get_tags %} {{ tag }} {% if not forloop.last %}, {% endif %} {% endfor %} |