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 88
99
1010class Book (models .Model ):
11- name = models .CharField (max_length = 100 ) # [consider-using-bulk-create]
11+ name = models .CharField (max_length = 100 )
1212
1313 class Meta :
1414 app_label = "test_app"
@@ -33,3 +33,9 @@ def assigned_for_create():
3333def for_filter ():
3434 for i in range (10 ):
3535 _ = 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 11consider-using-bulk-create:19:8:19:40:for_create:Consider using 'Model.bulk_create()':UNDEFINED
22consider-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