I am trying to do a database insert, with a table that has about twenty rows. The insert looks like this:
if not title.name:
title.name = data['title']
if not title.synopsis:
title.synopsis = data['synopsis']
...
Basically, I am updating the rows if they don't exist for every db column.
What would be a cleaner, more efficient way to do this?