diff --git a/prednasky/admin.py b/prednasky/admin.py index 1e5c5889..a9b94ee0 100644 --- a/prednasky/admin.py +++ b/prednasky/admin.py @@ -2,35 +2,40 @@ from django.contrib import admin from django.contrib import messages from reversion.admin import VersionAdmin +from django.utils.safestring import mark_safe +from django.utils.html import escape from models import Prednaska, Seznam, STAV_NAVRH from seminar.models import Soustredeni -from django.utils.safestring import mark_safe class Seznam_PrednaskaInline(admin.TabularInline): model = Prednaska.seznamy.through extra = 0 - def prednaska__nazev(self, instance): + def prednaska__nazev(self, obj): return mark_safe( u"{}".format( - instance.prednaska.id, - instance.prednaska.nazev + obj.prednaska.id, + escape(obj.prednaska.nazev) ) ) - def prednaska__popis(self, instance): - return instance.prednaska.popis + def prednaska__popis(self, obj): + return mark_safe( + u"