Results of 1 - 5 of about 5 for Restaurant (0.014 sec.)
- 一対一 (one-to-one) 関係 — Django 4.0.6 ドキュメント 12832
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
eld . In this example, a Place optionally can be a Restaurant : from django.db import models class Place ( model ...
self ): return " %s the place" % self . name class Restaurant ( models . Model ): place = models . OneToOneField ...
lt = False ) def __str__ ( self ): return " %s the restaurant" % self . place . name class Waiter ( models . Mod ...
el ): restaurant = models . ForeignKey ( Restaurant , on_delete = m ...
-
https://man.plustar.jp/django/topics/db/examples/one_to_one.html
- [similar]
- モデル — Django 4.0.6 ドキュメント 8548
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
tabase. Then, if you wanted to build a database of restaurants on top of the places, instead of repeating yourse ...
lf and replicating those fields in the Restaurant model, you could make Restaurant have a OneToOneFi ...
eld to Place (because a restaurant "is a" place; in fact, to handle this you'd typica ...
models from geography.models import ZipCode class Restaurant ( models . Model ): # ... zip_code = models . Fore ...
-
https://man.plustar.jp/django/topics/db/models.html
- [similar]
- QuerySet API リファレンス — Django 4.0.6 ドキュメント 8365
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
記の例二以下のモデルを追加したと考えましょう: class Restaurant ( models . Model ): pizzas = models . ManyToManyFi ...
eld ( Pizza , related_name = 'restaurants' ) best_pizza = models . ForeignKey ( Pizza , rel ...
on_delete = models . CASCADE ) 以下は適切です: >>> Restaurant . objects . prefetch_related ( 'pizzas__toppings' ...
ザのため、そしてもう一つはトッピングのためです。 >>> Restaurant . objects . prefetch_related ( 'best_pizza__toppin ...
-
https://man.plustar.jp/django/ref/models/querysets.html
- [similar]
- Django オブジェクトのシリアル化 — Django 4.0.6 ドキュメント 8218
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
ame = models . CharField ( max_length = 50 ) class Restaurant ( Place ): serves_hot_dogs = models . BooleanField ...
( default = False ) If you only serialize the Restaurant model: data = serializers . serialize ( 'xml' , Re ...
will be ignored. In order to fully serialize your Restaurant instances, you will need to serialize the Place mo ...
dels as well: all_objects = [ * Restaurant . objects . all (), * Place . objects . all ()] da ...
-
https://man.plustar.jp/django/topics/serialization.html
- [similar]
- Model Meta options — Django 4.0.6 ドキュメント 7942
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
, must be unique: unique_together = [[ 'driver' , 'restaurant' ]] This is a list of lists that must be unique wh ...
gle set of fields: unique_together = [ 'driver' , 'restaurant' ] A ManyToManyField cannot be included in unique_ ...
-
https://man.plustar.jp/django/ref/models/options.html
- [similar]
PREV
1
NEXT