File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
pylint_django/tests/input Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
10
10
class Book (models .Model ):
11
- name = models .CharField (max_length = 100 ) # [consider-using-bulk-create]
11
+ name = models .CharField (max_length = 100 )
12
12
13
13
class Meta :
14
14
app_label = "test_app"
@@ -33,3 +33,9 @@ def assigned_for_create():
33
33
def for_filter ():
34
34
for i in range (10 ):
35
35
_ = Book .objects .filter (name = str (i )) # [consider-using-in-queries]
36
+
37
+
38
+ def for_save ():
39
+ obj = Book (name = "Test Book" )
40
+ for _ in range (10 ):
41
+ obj .save () # [consider-using-bulk-create-save]
Original file line number Diff line number Diff line change 1
1
consider-using-bulk-create:19:8:19:40:for_create:Consider using 'Model.bulk_create()':UNDEFINED
2
2
consider-using-bulk-create:25:12:25:44:for_nested_if_create:Consider using 'Model.bulk_create()':UNDEFINED
3
- consider-using-bulk-create:30:12:30:49:assigned_for_create:Consider using 'Model.bulk_create()':UNDEFINED
4
- consider-using-in-queries:35:12:35:49:for_filter:Consider using 'Model.bulk_*():UNDEFINED
3
+ consider-using-bulk-create:30:12:30:44:assigned_for_create:Consider using 'Model.bulk_create()':UNDEFINED
4
+ consider-using-in-queries:35:12:35:44:for_filter:Consider using '__in' queries:UNDEFINED
5
+ consider-using-bulk-create-save:41:8:41:18:for_save:Consider using 'Model.bulk_*():UNDEFINED
You can’t perform that action at this time.
0 commit comments