想要在django脆皮严密博中的unicode角色

发布于 2025-02-06 03:19:56 字数 768 浏览 2 评论 0原文

我试图让人字形成为脆皮严密炸薯条中的价值。应该看起来像 此:

但是,我所得到的只是一个小框中的代码: 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

筱果果 2025-02-13 03:19:56

好的,我通过使用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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文