File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1515from django .forms import model_to_dict
1616from django .utils import timezone
1717
18- from python_utils .imports import import_optional_dependency
1918from python_utils .db import fetch_all
19+ from python_utils .imports import import_optional_dependency
2020
2121Model_T = TypeVar ('Model_T' , bound = Model )
2222
23+ logger = logging .getLogger (__name__ )
24+
2325
2426class ExtendedEncoder (DjangoJSONEncoder ): # pragma no cover
2527 """Custom JSON Encoder that processes fields like date etc."""
@@ -441,7 +443,7 @@ def safe_bulk_create(
441443 except AttributeError :
442444 continue
443445
444- model .objects .bulk_create (records , batch_size = batch_size )
446+ return model .objects .bulk_create (records , batch_size = batch_size )
445447
446448
447449def safe_bulk_update (
@@ -482,10 +484,8 @@ def safe_bulk_update(
482484 timestamp = timezone .now ()
483485 for record in records :
484486 setattr (record , updated_at_field , timestamp )
485- model .objects .bulk_update (records , fields , batch_size = batch_size )
486-
487487
488- logger = logging . getLogger ( __name__ )
488+ return model . objects . bulk_update ( records , fields , batch_size = batch_size )
489489
490490
491491def call_procedure (procedure_name : str , params : List [Any ] = None ):
Original file line number Diff line number Diff line change 11[metadata]
22name = cardo-python-utils
3- version = 0.1.2
3+ version = 0.1.3
44description = Python library enhanced with a wide range of functions for different scenarios.
55long_description = file: README.rst
66url = https://github.com/CardoAI/cardo-python-utils
You can’t perform that action at this time.
0 commit comments