Postgres Add Item To Python Dictionary Comprehension If Else