Ajout de suggestions de filtres par ville
This commit is contained in:
@@ -289,6 +289,7 @@
|
||||
{
|
||||
"com_name": "Clermont-Ferrand",
|
||||
"main": 10,
|
||||
"suggested": 10,
|
||||
"geo_point_2d": {
|
||||
"lon": 3.1153994509459313,
|
||||
"lat": 45.78590931605406
|
||||
@@ -339,6 +340,7 @@
|
||||
{
|
||||
"com_name": "Riom",
|
||||
"main": 3,
|
||||
"suggested": 10,
|
||||
"geo_point_2d": {
|
||||
"lon": 3.13259085594027,
|
||||
"lat": 45.89435053196184
|
||||
|
@@ -13,7 +13,10 @@ def run():
|
||||
# remove all locations
|
||||
ReferenceLocation.objects.all().delete()
|
||||
|
||||
objs = [ReferenceLocation(location=Point(c["geo_point_2d"]["lon"], c["geo_point_2d"]["lat"]), name=c["com_name"], main=c["main"] if "main" in c else 0) for c in data]
|
||||
objs = [ReferenceLocation(location=Point(c["geo_point_2d"]["lon"], c["geo_point_2d"]["lat"]),
|
||||
name=c["com_name"],
|
||||
main=c["main"] if "main" in c else 0,
|
||||
suggested_distance=c["suggested"] if "suggested" in c else None) for c in data]
|
||||
|
||||
objs = ReferenceLocation.objects.bulk_create(objs, ignore_conflicts=True)
|
||||
|
||||
|
Reference in New Issue
Block a user