admin K2O
using verbose_name will directly display it as text, which is not successful
found that there is a format_html () method, but it doesn"t seem to work here
can only be used on list_display ()
admin K2O
using verbose_name will directly display it as text, which is not successful
found that there is a format_html () method, but it doesn"t seem to work here
can only be used on list_display ()
this method, which needs to override the parent class, makes the verbose_name
tag a safe string.
class MarkSafeCharField(models.FloatField):
def formfield(self, **kwargs):
kwargs['label'] = mark_safe(self.verbose_name)
return super().formfield(**kwargs)
-sharp
name= MarkSafeCharField(verbose_name='K<sub>2</sub>0')
you can see what you want:
Previous: Can css media query be queried with fixed width?
Next: Who can change the following js method to PHP method for me?