メザニンを使用しています。モデルがあります:
class AssignedKeyword(Orderable):
"""
A ``Keyword`` assigned to a model instance.
"""
keyword = models.ForeignKey("Keyword", related_name="assignments")
content_type = models.ForeignKey("contenttypes.ContentType")
object_pk = models.IntegerField()
content_object = GenericForeignKey("content_type", "object_pk")
class Meta:
order_with_respect_to = "content_object"
def __unicode__(self):
return unicode(self.keyword)
content_object
フィールドのタイプが であるすべての一意の AssignedKeyword モデル インスタンスを取得したいと考えていますPost
。フィールドのタイプでクエリセットをフィルタリングするにはどうすればよいですか?