@@ -34,7 +34,7 @@ def test_save1_store():
3434
3535def test_save1_load ():
3636 obj = TestSave1 .objects .first ()
37- SINK (obj .text )
37+ SINK (obj .text ) # $ MISSING: flow
3838
3939# --------------------------------------
4040# Constructor: positional arg
@@ -50,7 +50,7 @@ def test_save2_store():
5050
5151def test_save2_load ():
5252 obj = TestSave2 .objects .first ()
53- SINK (obj .text )
53+ SINK (obj .text ) # $ MISSING: flow
5454
5555# --------------------------------------
5656# Constructor: positional arg, with own primary key
@@ -65,7 +65,7 @@ def test_save3_store():
6565
6666def test_save3_load ():
6767 obj = TestSave3 .objects .first ()
68- SINK (obj .text )
68+ SINK (obj .text ) # $ MISSING: flow
6969
7070# --------------------------------------
7171# Set attribute on fresh object
@@ -80,7 +80,7 @@ def test_save4_store():
8080
8181def test_save4_load ():
8282 obj = TestSave4 .objects .first ()
83- SINK (obj .text )
83+ SINK (obj .text ) # $ MISSING: flow
8484
8585# --------------------------------------
8686# Set attribute on existing
@@ -101,7 +101,7 @@ def test_save4b_store():
101101
102102def test_save4b_load ():
103103 obj = TestSave4b .objects .first ()
104- SINK (obj .text )
104+ SINK (obj .text ) # $ MISSING: flow
105105
106106# --------------------------------------
107107# <Model>.objects.create()
@@ -113,11 +113,11 @@ class TestSave5(models.Model):
113113def test_save5_store ():
114114 # note: positional args not possible
115115 obj = TestSave5 .objects .create (text = SOURCE )
116- SINK (obj .text )
116+ SINK (obj .text ) # $ MISSING: flow
117117
118118def test_save5_load ():
119119 obj = TestSave5 .objects .first ()
120- SINK (obj .text )
120+ SINK (obj .text ) # $ MISSING: flow
121121
122122# --------------------------------------
123123# <Model>.objects.get_or_create()
@@ -129,13 +129,13 @@ class TestSave6(models.Model):
129129
130130def test_save6_store ():
131131 obj , _created = TestSave6 .objects .get_or_create (defaults = {"text" : SOURCE }, email = SOURCE )
132- SINK (obj .text )
133- SINK (obj .email )
132+ SINK (obj .text ) # $ MISSING: flow
133+ SINK (obj .email ) # $ MISSING: flow
134134
135135def test_save6_load ():
136136 obj = TestSave6 .objects .first ()
137- SINK (obj .text )
138- SINK (obj .email )
137+ SINK (obj .text ) # $ MISSING: flow
138+ SINK (obj .email ) # $ MISSING: flow
139139
140140# --------------------------------------
141141# <Model>.objects.update_or_create()
@@ -147,13 +147,13 @@ class TestSave7(models.Model):
147147
148148def test_save7_store ():
149149 obj , _created = TestSave7 .objects .update_or_create (defaults = {"text" : SOURCE }, email = SOURCE )
150- SINK (obj .text )
151- SINK (obj .email )
150+ SINK (obj .text ) # $ MISSING: flow
151+ SINK (obj .email ) # $ MISSING: flow
152152
153153def test_save7_load ():
154154 obj = TestSave7 .objects .first ()
155- SINK (obj .text )
156- SINK (obj .email )
155+ SINK (obj .text ) # $ MISSING: flow
156+ SINK (obj .email ) # $ MISSING: flow
157157
158158# --------------------------------------
159159# <Model>.objects.[<QuerySet>].update()
@@ -169,7 +169,7 @@ def test_save8_store():
169169
170170def test_save8_load ():
171171 obj = TestSave8 .objects .first ()
172- SINK (obj .text )
172+ SINK (obj .text ) # $ MISSING: flow
173173
174174# --------------------------------------
175175# .save() on foreign key field
@@ -192,7 +192,7 @@ def test_save9_store():
192192
193193def test_save9_load ():
194194 obj = TestSave9 .objects .first ()
195- SINK (obj .text )
195+ SINK (obj .text ) # $ MISSING: flow
196196
197197# --------------------------------------
198198# foreign key backreference (auto-generated name)
@@ -219,7 +219,7 @@ def test_save10_store():
219219
220220def test_save10_load ():
221221 obj = save10_Comment .objects .first ()
222- SINK (obj .text )
222+ SINK (obj .text ) # $ MISSING: flow
223223
224224# --------------------------------------
225225# foreign key backreference, with custom name
@@ -246,7 +246,7 @@ def test_save11_store():
246246
247247def test_save11_load ():
248248 obj = save11_Comment .objects .first ()
249- SINK (obj .text )
249+ SINK (obj .text ) # $ MISSING: flow
250250
251251# ------------------------------------------------------------------------------
252252# Different ways to load data from the DB through the ORM
@@ -263,61 +263,61 @@ def test_load_init():
263263
264264def test_load_single ():
265265 obj = TestLoad .objects .get (id = 1 )
266- SINK (obj .text )
266+ SINK (obj .text ) # $ MISSING: flow
267267
268268def test_load_many ():
269269 objs = TestLoad .objects .all ()
270270 for obj in objs :
271- SINK (obj .text )
272- SINK (objs [0 ].text )
271+ SINK (obj .text ) # $ MISSING: flow
272+ SINK (objs [0 ].text ) # $ MISSING: flow
273273
274274def test_load_many_skip ():
275275 objs = TestLoad .objects .all ()[5 :]
276276 for obj in objs :
277- SINK (obj .text )
278- SINK (objs [0 ].text )
277+ SINK (obj .text ) # $ MISSING: flow
278+ SINK (objs [0 ].text ) # $ MISSING: flow
279279
280280def test_load_qs_chain_single ():
281281 obj = TestLoad .objects .all ().filter (text__contains = "s" ).exclude (text = None ).first ()
282- SINK (obj .text )
282+ SINK (obj .text ) # $ MISSING: flow
283283
284284def test_load_qs_chain_many ():
285285 objs = TestLoad .objects .all ().filter (text__contains = "s" ).exclude (text = None )
286286 for obj in objs :
287- SINK (obj .text )
288- SINK (objs [0 ].text )
287+ SINK (obj .text ) # $ MISSING: flow
288+ SINK (objs [0 ].text ) # $ MISSING: flow
289289
290290def test_load_values ():
291291 # see https://docs.djangoproject.com/en/4.0/ref/models/querysets/#django.db.models.query.QuerySet.values
292292 vals = TestLoad .objects .all ().values ()
293293 for val in vals :
294- SINK (val ['text' ])
295- SINK (vals [0 ]['text' ])
294+ SINK (val ['text' ]) # $ MISSING: flow
295+ SINK (vals [0 ]['text' ]) # $ MISSING: flow
296296
297297 # only selecting some of the fields
298298 vals = TestLoad .objects .all ().values ("text" )
299299 for val in vals :
300- SINK (val ['text' ])
301- SINK (vals [0 ]['text' ])
300+ SINK (val ['text' ]) # $ MISSING: flow
301+ SINK (vals [0 ]['text' ]) # $ MISSING: flow
302302
303303def test_load_values_list ():
304304 # see https://docs.djangoproject.com/en/4.0/ref/models/querysets/#django.db.models.query.QuerySet.values_list
305305 vals = TestLoad .objects .all ().values_list ()
306306 for (_id , text ) in vals :
307- SINK (text )
308- SINK (vals [0 ][1 ])
307+ SINK (text ) # $ MISSING: flow
308+ SINK (vals [0 ][1 ]) # $ MISSING: flow
309309
310310 # only selecting some of the fields
311311 vals = TestLoad .objects .all ().values_list ("text" )
312312 for (text ,) in vals :
313- SINK (text )
314- SINK (vals [0 ][0 ])
313+ SINK (text ) # $ MISSING: flow
314+ SINK (vals [0 ][0 ]) # $ MISSING: flow
315315
316316 # with flat=True, each row will not be a tuple, but just the value
317317 vals = TestLoad .objects .all ().values_list ("text" , flat = True )
318318 for text in vals :
319- SINK (text )
320- SINK (vals [0 ])
319+ SINK (text ) # $ MISSING: flow
320+ SINK (vals [0 ]) # $ MISSING: flow
321321
322322# Good resources:
323323# - https://docs.djangoproject.com/en/4.0/topics/db/queries/#making-queries
0 commit comments