Skip to content

Conversation

@dmytrotsko
Copy link
Collaborator

No description provided.

Copy link

@melange396 melange396 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

If you wanted to be a little less verbose you could subclass models.Manager and write a wrapper for get() as described in https://stackoverflow.com/a/3090342

Also mentioned there: you can use .objects.filter(id=row["XYZ"]).first() instead of .objects.get(...) to avoid the try/except, but that can have performance issues (probably not that bad with a db as small as this ¯\_(ツ)_/¯ ).

Try those only if you feel like it!!!

@korlaxxalrok korlaxxalrok removed their request for review June 10, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants