我有一个使用 django-taggit TaggableManager 的模型:
from django.db import models
from model_utils import Choices
from taggit_autosuggest.managers import TaggableManager
LANGUAGE_CHOICES = Choices(
('de', 'Allemand - Deutch'),
('en', 'Anglais - English'),
('es', 'Espagnol - Español'),
('fr', 'Français'),
('it', 'Italien - Italiano'),
('jp', 'Japonais - 日本語'),
('ko', 'Coréen - 한국어'),
('pt', 'Portugais - Português'),
('th', 'Thaï - ไทย'),
('vi', 'Vietnamien - Tiếng Việt'),
('zh', 'Chinois - 中文'),
)
class Recipe(models.Model):
language = language = models.CharField(
max_length=5,
choices=LANGUAGE_CHOICES,
default=LANGUAGE_CHOICES.en
)
tags = tags = TaggableManager(
help_text="Use tab to add a new term.",
blank=True
)
如何使用相关的食谱语言获取所有食谱标签?