I've actually been trying to code a wonder like that but there's no way I can figure without it looking kinda sloppy.
See there's nothing in the python, as far as I know that will just do that. So you'd have to on building built give + relations with all other players, which is fine and easy. But then you'd need checks on citylost and cityaquired to add and take away relations, as well on techaquired for if it obsoletes. the problem is, say you lose and regain the city once and it normally would give say +3, the diplomacy panel would get crowded showing -3, +6. which is fine but i'd like to do it neater.