|
|
@ -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"<a href='/admin/prednasky/prednaska/{}'>{}</a>".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"<div style='width: 200px'>{}</div>".format( |
|
|
|
escape(obj.prednaska.popis) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
def prednaska__anotace(self, instance): |
|
|
|
return instance.prednaska.anotace |
|
|
|
def prednaska__anotace(self, obj): |
|
|
|
return obj.prednaska.anotace |
|
|
|
|
|
|
|
def prednaska__org(self, instance): |
|
|
|
return instance.prednaska.org |
|
|
|
def prednaska__org(self, obj): |
|
|
|
return obj.prednaska.org |
|
|
|
|
|
|
|
def prednaska__obor(self, instance): |
|
|
|
return instance.prednaska.obor |
|
|
|
def prednaska__obor(self, obj): |
|
|
|
return obj.prednaska.obor |
|
|
|
|
|
|
|
prednaska__nazev.short_description = u'Přednáška' |
|
|
|
prednaska__popis.short_description = u'Popis pro orgy' |
|
|
|