Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use logging.warning instead of deprecated/removed logging.warn method #123

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions django_seed/seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def func(inserted):
message = "Field {} cannot be null".format(field)
raise SeederException(message)
else:
logging.warn(
logging.warning(
"Could not build many-to-many relationship for between {} and {}".format(
field,
related_model,
Expand Down Expand Up @@ -125,10 +125,10 @@ def guess_field_formatters(self, faker, formatters=None):
formatters[field_name] = formatter
continue

for field in self.model._meta.many_to_many:
self.many_relations[field.name] = self.build_many_relation(
field, field.related_model
)
# for field in self.model._meta.many_to_many:
# self.many_relations[field.name] = self.build_many_relation(
# field, field.related_model
# )

return formatters

Expand Down Expand Up @@ -248,12 +248,12 @@ def execute(self, using=None, inserted_entities={}):
# continue testing on an IntegrityError
with transaction.atomic():
executed_entity = entity.execute(using, inserted_entities)

inserted_entities[klass].append(executed_entity)
completed_count += 1
except IntegrityError as err:
last_error = err

# Exit if the right number of entities has been inserted
if completed_count == number:
break
Expand Down