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):
13
13
title = models .CharField (max_length = 200 )
14
14
cuisine = models .CharField (max_length = 200 )
15
15
cook_time = models .IntegerField (default = 0 )
16
- prep_time = models .IntegerField (default = 0 )
17
16
allergens = ArrayField (models .CharField (max_length = 100 ), null = True , blank = True )
18
17
nutrition = EmbeddedModelField (Nutrition , null = True , blank = True )
19
18
@@ -33,7 +32,8 @@ class Meta:
33
32
# end-single-field-meta
34
33
35
34
# 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 )
37
37
# end-single-field-option
38
38
39
39
# start-compound
@@ -81,13 +81,4 @@ class Meta:
81
81
models .UniqueConstraint (fields = ["title" , "cuisine" ],
82
82
name = "unique_regional_meal" ),
83
83
]
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:
294
294
- :manual:`Single Field Indexes </core/index-single/>`
295
295
- :manual:`Compound Indexes </core/index-compound/>`
296
296
- :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/>`
298
298
- :manual:`Partial Indexes </core/index-partial/>`
299
299
- :manual:`Unique Indexes </core/index-unique/>`
300
300
You can’t perform that action at this time.
0 commit comments