Untitled
unknown
plain_text
3 months ago
681 B
8
Indexable
@admin.display(description='Превью', ordering='title')
def preview_thumbnail(self, obj):
if obj.preview_image:
return format_html('<img src="{}" width="60" height="60" style="border-radius: 8px; object-fit: cover; box-shadow: 0 2px 4px rgba(0,0,0,0.1);" />', obj.preview_image.url)
# FIX: Added {} and passed the emoji as an argument
return format_html(
'<div style="width: 60px; height: 60px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px;">{}</div>',
"🦸♂️"
)Editor is loading...
Leave a Comment