Hi All,
I have the following update or insert statement in a controller.
db.grades.update_or_insert(
score=score)
The function that this is part of is called as the result of a user pressing a button on the web page. It could get pressed multiple times in quick succession. (Yes, I'll fix that too). ButI was surprised that I end up with duplicate values every now and then. This is on top of Postgresql with psycopg2 driver. I added a constraint to the table definition to ensure that user,assignment pairs are unique and now at least I can catch the IntegrityErrors when they happen.
Since this is running in an multi-process environment I guess I could see how this might happen, but it seems like a bug. Or am I doing something stupid?
Brad