简体   繁体   English

名称中带有空格的Django-taggit标签?

[英]Django-taggit tags with whitespace in name?

How can I use tags with whitespace char in their name with django-taggit? 如何在带有django-taggit的名称中使用带有空格字符的标签? For example, "Some simple tag"? 例如“一些简单标签”? Because if I ctrl-c=>ctrl-v some phrase to tags field in my admin panel, on page with this tag i get something like this: 因为如果我ctrl-c => ctrl-v在管理面板中的标签字段中使用了一些短语,则在带有此标签的页面上,我得到的是这样的:

Reverse for 'posts_by_tag' with arguments '()' and keyword arguments '{u'tag':
u'\u0411\u0430\u043d\u043a \u0422\u0430\u0432\u0440\u0438\u043a\u0430'}'
not found. 1 pattern(s) tried: ['blog-list/posts/(?P<tag>\\w+)$']

, but if I try add tag with whitespace-it just cut on whitespace char and starts new tag. ,但是如果我尝试使用空白添加标签-它只会切入空白char并启动新标签。 How can I fix it? 我该如何解决?

Multi-word tags in Wagtail need to be quoted, eg "my tag". Wa中的多字标签需要加引号,例如“我的标签”。

There are two pull requests open that address this topic: 有两个打开的拉取请求可解决此主题:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM