python sql-dictionary join