[英]Can I get all tags used in django-taggit short of raw sql?
I want to have a user select tags with a radio button widget, not with a char box. 我希望用户选择带有单选按钮小部件的标签,而不是带有字符框。 So I want to get all candidate tags as in "SELECT slug,name FROM taggit_tag;".
所以我想得到所有候选标签,如“SELECT slug,name FROM taggit_tag;”。 Is there a way to do that without issuing raw sql?
有没有办法在不发出原始sql的情况下这样做? (I am shy of the transaction handling, which has bit me in the past.)
(我对交易处理感到害羞,过去曾经让我感到困惑。)
from taggit.models import Tag
tags = Tag.objects.all()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.