有没有办法找到包含特定内容类型的页面(查询)。
假设我有一个内容类型为的页面(注销)LogoutFormContent
。
如何找到将 LougOutFormContent 作为内容类型的页面。
我试图这样做:
page = Page.objects.filter(logoutformcontent_set=True)
生成以下查询
SELECT * FROM `page_page` INNER JOIN `page_page_logoutformcontent`
ON (`page_page`.`id` = `page_page_logoutformcontent`.`parent_id`)
WHERE (`page_page_logoutformcontent`.`id` = 1)
这几乎是正确的,除了page_page_logoutformcontent.id = 1
???