I'm having a hard time understanding some of my own code, which no longer works. The only way I can see it having worked in the past is if auto-flushing did not call before_flush, but commit did? Is that possible?
Somehow I was managing to create instances (in Python) and populate them with auto-generated key values from the database, but then filter out some objects (those with certain attributes null) and never commit them to the database (in before_flush).
I realise this is a somewhat confusing question, sorry, and I can probably fix my code anyway. I am just looking for some peace of mind in understanding how on earth it ever worked.