def _tx(): site = Site.get_by_key_name(loc["id"]) if site is None: site = Site(key_name=loc["id"]) site.location = GeoPt(lat = loc["location"][0], lon = loc["location"][1]) site.name = loc["name"] site.region = loc["region"] site.save()