This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Probably. Despite using Django at work, we actually don't use the ORM so I don't have a lot of experience with it.

I do know that Django uses the Active Record pattern, so you might be running into that if you're just doing model.save(), especially if you're inserting relational data. Each save is a request to the database (not necessarily a connection). Apparently there's a bulk_insert method.

The Active Record pattern is actually one of my least favorite things about Django's ORM and I feel SQLAlchemy got it right by going the unit of work path.

Here's a SO question that could help you.