'
for i, media in enumerate(obj.media_files):
if media.get('type') == 'image':
html += f'
'
elif media.get('type') == 'video':
html += f'
'
html += '
'
return format_html(html)
media_files_display.short_description = '媒体文件'
def actions_column(self, obj):
"""操作列"""
# 修改: 添加跳转到本地文章详情页的链接
return format_html(
'