Compare commits
No commits in common. "9460c484f72c98648e4a0f623c34a5fa74965c8a" and "5d4b600b00c79864f39a4f03f5f0afdd71e5973a" have entirely different histories.
9460c484f7
...
5d4b600b00
3 changed files with 1 additions and 33 deletions
|
@ -36,7 +36,6 @@ extensions = [
|
|||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'myst_parser',
|
||||
'sphinxcontrib_django',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
|
|
|
@ -58,40 +58,10 @@ class Seznam_PrednaskaInline(admin.TabularInline):
|
|||
def has_add_permission(self, req, obj): return False
|
||||
|
||||
|
||||
class Seznam_ZnalostInline(admin.TabularInline):
|
||||
"""
|
||||
Pomůcka pro :py:class:`prednasky.admin.SeznamAdmin` zobrazující hezky :py:class:`Znalosti <prednasky.models.Znalost>`
|
||||
v adminu :py:class:`Seznamu <prednasky.models.Seznam>`.
|
||||
"""
|
||||
model = Znalost.seznamy.through
|
||||
extra = 0
|
||||
|
||||
def znalost__nazev(self, obj):
|
||||
return mark_safe(
|
||||
f"<a href='/admin/prednasky/znalost/{obj.znalost.id}'>{obj.znalost.nazev}</a>"
|
||||
)
|
||||
|
||||
def znalost__text(self, obj):
|
||||
return mark_safe(
|
||||
f"<div style='width: 200px'>{escape(obj.znalost.text)}</div>"
|
||||
)
|
||||
|
||||
znalost__nazev.short_description = u'Přednáška'
|
||||
znalost__text.short_description = u'Popis pro orgy'
|
||||
|
||||
readonly_fields = [
|
||||
'znalost__nazev',
|
||||
'znalost__text',
|
||||
]
|
||||
exclude = ['znalost']
|
||||
|
||||
def has_add_permission(self, req, obj): return False
|
||||
|
||||
|
||||
class SeznamAdmin(VersionAdmin):
|
||||
""" Admin pro :py:class:`Seznam <prednasky.models.Seznam>` """
|
||||
list_display = ['soustredeni', 'stav']
|
||||
inlines = [Seznam_PrednaskaInline, Seznam_ZnalostInline]
|
||||
inlines = [Seznam_PrednaskaInline]
|
||||
|
||||
admin.site.register(Seznam, SeznamAdmin)
|
||||
|
||||
|
|
|
@ -49,5 +49,4 @@ lorem
|
|||
|
||||
sphinx
|
||||
sphinx_rtd_theme
|
||||
sphinxcontrib-django
|
||||
myst_parser
|
||||
|
|
Loading…
Reference in a new issue