I figured I'd hit up the group. PyOhio is a pretty great local Python
conference that takes place at the end of July. They're currently accepting
submissions for talks. It's a bit smaller and more informal than something
like PyCon, so it's a great place to give a talk at. They keep expanding
What I tend to do in cases like this is to break things into commit chunks.
For instance, I've got an import script that goes through and processes 10
at a time and performs a commit every 10. This is tweakable via a config
setting, but so far 10 works for my needs.
As for the duplicates, If
What is the error that you're getting? Is it just that the value is None?
You're doing a left outer join which means you might gets rows back that
don't have any member record data tied to it. In that case you need to check
if you have a member first, then access the properties on it.
% if
Not that I'm aware of. When you do a Session.add() it's not touching the
database yet. It's part of the performance tradeoff. There's not a good way
for it to *know* there's a record in the db with that pk id until it does
chat with the db on it. Sure, you can keep a list of ids on the side if
I'm not sure, but I'd check the exception and see if you can get the info
about which of your 50 were the dupe. I don't recall if it's in the
traceback or exception error. If you can identify it then you could store it
aside and remove it from the session and retry the other 49 again.