per page, with , order by , clip by
Results of 1 - 1 of about 1 for Fullerton (0.001 sec.)
一対一 (one-to-one) 関係 9414
一対一 (one-to-one) 関係 一対一の関係を定義するには、 OneToOneField を使用します。 この例では、 Place は任意で Restaurant になることができます: from django.db import models class Place ( models . Model ): name = models . CharField ( max_len ... PI の機能を使って実行できる操作の例です。 2つの Place を作成する: >>> p1 = Place ( name = "Demon Dogs" , address = "944 W. Fullerton" ) >>> p1 . save () >>> p2 = Place ( name = "Ace Hardware" , address = "1013 N. Ashland" ) >>> p2 . save () レストランを作 ... ていない Place で Restaurant を作成すると ValueError が発生します: >>> p3 = Place ( name = "Demon Dogs" , address = "944 W. Fullerton" ) >>> Restaurant . objects . create ( place = p3 , serves_hot_dogs = True , serves_pizza = False ) Traceback (most recent ...
https://man.mtool.work/django/6.1/topics/db/examples/one_to_one.html
PREV 1 NEXT