per page, with , order by , clip by
Results of 1 - 1 of about 1 for wonders (0.001 sec.)
多対多 (many-to-many) 関係 9414
多対多 (many-to-many) 関係 多対多の関係を定義するには、 ManyToManyField を使用します。 この例では、一つの Article は複数の Publication オブジェクトに掲載することができ、一つの Publication は複数の Article オブジェクトを持ちます: from django ... > キーワードを使った反対側の端からの追加: >>> new_article = p2 . article_set . create ( headline = "Oxygen-free diet works wonders" ) >>> p2 . article_set . all () <QuerySet [<Article: NASA finds intelligent life on Earth>, <Article: Oxygen-free diet wo ... rks wonders>]> >>> a5 = p2 . article_set . all ()[ 1 ] >>> a5 . publications . all () <QuerySet [<Publication: Science News>]> Article ... を削除する: >>> a4 . publications . remove ( p2 ) >>> p2 . article_set . all () <QuerySet [<Article: Oxygen-free diet works wonders>]> >>> a4 . publications . all () <QuerySet []> 反対側からも: >>> p2 . article_set . remove ( a5 ) >>> p2 . article_set . ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_many.html
PREV 1 NEXT