Print debug messages while import
This commit is contained in:
parent
f1eaedbd14
commit
1460664145
1 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import django.db.utils
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
|
|
||||||
|
@ -401,7 +402,14 @@ class Command(BaseCommand):
|
||||||
try:
|
try:
|
||||||
m = _model(**_object_dict)
|
m = _model(**_object_dict)
|
||||||
m.save()
|
m.save()
|
||||||
|
except django.db.utils.IntegrityError as ex1:
|
||||||
|
error_row_count += 1
|
||||||
|
print(str(ex1))
|
||||||
|
print("**********************")
|
||||||
|
print(str(_object_dict))
|
||||||
|
print("**********************")
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
error_row_count += 1
|
||||||
print('-----')
|
print('-----')
|
||||||
print(str(ex))
|
print(str(ex))
|
||||||
print('----------------')
|
print('----------------')
|
||||||
|
|
Loading…
Reference in a new issue