想要在django脆皮严密博中的unicode角色
我试图让人字形成为脆皮严密炸薯条中的价值。应该看起来像 此:
但是,我所得到的只是一个小框中的代码: box中的unicode
我已经尝试了以下方法:
def __unicode__(self, this_char):
return u"%s" % this_char
StrictButton(self.__unicode__('\uF282'),
css_class="btn btn-outline-secondary btn-sm",
id="button-id-right")
并
StrictButton('\uF282',
css_class="btn btn-outline-secondary btn-sm",
id="button-id-right")
得到相同的结果。我尝试嵌入HTML字符串,希望浏览器能捕获它 - 无效。
谢谢
I'm trying to get a chevron to be the value in a crispy strictbutton. It should look like
this: https://icons.getbootstrap.com/icons/chevron-down/
But, all I get is code in a little box:
unicode in the box
I've tried this:
def __unicode__(self, this_char):
return u"%s" % this_char
StrictButton(self.__unicode__('\uF282'),
css_class="btn btn-outline-secondary btn-sm",
id="button-id-right")
and this:
StrictButton('\uF282',
css_class="btn btn-outline-secondary btn-sm",
id="button-id-right")
and get the same result. I've tried embedding the html string hoping the browser would catch it - didn't work.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我通过使用html()而不是严格键盘解决了这个问题。我仍然想知道该怎么做,而不必写出所有HTML。
OK, I solved this by using HTML() instead of a StrictButton. I'd still like to know how to do this instead of having to write out all the html.