... "Demon Dogs" , address = "944 W. Fullerton" ) >>> p1 . save () >>> p2 = Place ( name = "Ace Hardware" , address = "1013 N. Ashland" ) >>> p2 . save () レストランを作成する。オブジェクトの主キーとして "parent" オブジェクトを渡します: >>> r = Restaurant ( ... n" ) <QuerySet [<Restaurant: Demon Dogs the restaurant>]> >>> Restaurant . objects . exclude ( place__address__contains = "Ashland" ) <QuerySet [<Restaurant: Demon Dogs the restaurant>]> これは逆方向にも機能します: >>> Place . objects . get ( pk = 1 ) < ... 2026年10月08日