Browse Source

Merge branch 'matej-drobna-vylepseni'

remotes/origin/test
Matěj Kocián 8 years ago
parent
commit
dedd88995e
  1. 4
      seminar/admin.py

4
seminar/admin.py

@ -495,6 +495,8 @@ class ProblemZadanyAdmin(ProblemAdmin):
] ]
def cislo_zadani_link(self, obj): def cislo_zadani_link(self, obj):
if not obj.cislo_zadani:
return ""
return mark_safe('<a href="{}">{}</a>'.format( return mark_safe('<a href="{}">{}</a>'.format(
reverse("admin:seminar_cislo_change", args=(obj.cislo_zadani.pk,)), reverse("admin:seminar_cislo_change", args=(obj.cislo_zadani.pk,)),
obj.cislo_zadani obj.cislo_zadani
@ -505,6 +507,8 @@ class ProblemZadanyAdmin(ProblemAdmin):
# nějak zjednodušit, např. tímto? # nějak zjednodušit, např. tímto?
# https://github.com/gitaarik/django-admin-relation-links # https://github.com/gitaarik/django-admin-relation-links
def cislo_reseni_link(self, obj): def cislo_reseni_link(self, obj):
if not obj.cislo_reseni:
return ""
return mark_safe('<a href="{}">{}</a>'.format( return mark_safe('<a href="{}">{}</a>'.format(
reverse("admin:seminar_cislo_change", args=(obj.cislo_reseni.pk,)), reverse("admin:seminar_cislo_change", args=(obj.cislo_reseni.pk,)),
obj.cislo_reseni obj.cislo_reseni

Loading…
Cancel
Save