Python Array Add Element If Not Exists In Sql