So I have some buttons in django admin and I need to add something like that: ⬅️➡️↩️↪️ to my admin buttons, but I have 0 idea how to do this and I feel like I am the first ever person to ask that question on the internet, google didnt help :)) Can you guys suggest something?
This is not all my code as you probably already understood, but above code change_actions is probably what makes the button appear along with other buttons. But I am unsure how to add this ➡️ emoji there, cuz its causing errors
CodePudding user response:
Maybe this is what you want:
from django.utils.html import format_html
def rotate_left_button(self, request, queryset):
return format_html('<button >{} Rotate left</button>', '⬅️')
rotate_left_button.short_description = format_html('{} Rotate left', '⬅️')