File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ class Recipe(models.Model):
1313 title = models .CharField (max_length = 200 )
1414 cuisine = models .CharField (max_length = 200 )
1515 cook_time = models .IntegerField (default = 0 )
16- prep_time = models .IntegerField (default = 0 )
1716 allergens = ArrayField (models .CharField (max_length = 100 ), null = True , blank = True )
1817 nutrition = EmbeddedModelField (Nutrition , null = True , blank = True )
1918
@@ -33,7 +32,8 @@ class Meta:
3332# end-single-field-meta
3433
3534# start-single-field-option
36- title = models .CharField (max_length = 200 , db_index = True )
35+ class Recipe (models .Model ):
36+ title = models .CharField (max_length = 200 , db_index = True )
3737# end-single-field-option
3838
3939# start-compound
@@ -81,13 +81,4 @@ class Meta:
8181 models .UniqueConstraint (fields = ["title" , "cuisine" ],
8282 name = "unique_regional_meal" ),
8383 ]
84- # end-unique-compound
85-
86- # start-expression
87- class Meta :
88- db_table = "recipes"
89- indexes = [
90- models .Index (expressions = F ("cook_time" ) + F ("prep_time" ),
91- name = "total_time_idx" ),
92- ]
93- # end-expression
84+ # end-unique-compound
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ see the following {+mdb-server+} manual resources:
294294- :manual:`Single Field Indexes </core/index-single/>`
295295- :manual:`Compound Indexes </core/index-compound/>`
296296- :manual:`Multikey Indexes </core/index-multikey/>`
297- - :manual:`Embedded Document Indexes </core/index-single/create-embedded-object-index/>`
297+ - :manual:`Embedded Document Indexes </core/indexes/index-types/ index-single/create-embedded-object-index/>`
298298- :manual:`Partial Indexes </core/index-partial/>`
299299- :manual:`Unique Indexes </core/index-unique/>`
300300
You can’t perform that action at this time.
0 commit comments