mirror of
https://github.com/task-17-lct/backend.git
synced 2024-11-30 18:13:43 +03:00
loaded all places, events
This commit is contained in:
parent
57530461af
commit
63d4a0a850
1
data/bulvary.json
Normal file
1
data/bulvary.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"_id": {"$oid": "61c07987c53ae811d6e6b829"}, "dictionary_data": {"youtube_videos": [], "russpass_recommendation": false, "aac_images": [], "disable_sessionids_autoupdate": false, "information_pages": [], "type_audio_guide": [], "sessionIds": [], "social_buttons": [], "images": [{"source": {"id": "63da16a3961d4400a3ac475f"}}, {"source": {"id": "63da16a6961d4400a3ac476b"}}], "image_explore_preview": [{"source": {"id": "63da16a0961d4400a3ac4757"}}], "image_detailed_page_main": [], "tags_main_screen": ["5e4aa3aca7edd0687c4688e1"], "aac_tags": [], "duration": "30", "purchase_method": "free", "ticket_price": "0", "is_can_buy": false, "galereya": [], "recommendation_prime": [], "timetable_by_place": [], "schedule": [], "without_schedule": false, "description": "\u0421\u0430\u043c\u0430\u044f \u0441\u0442\u0430\u0440\u0430\u044f \u0438 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0411\u0443\u043b\u044c\u0432\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0434\u0432\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u2014 \u041d\u0438\u043a\u0438\u0442\u0441\u043a\u0438\u0445 \u0412\u043e\u0440\u043e\u0442 \u0438 \u041f\u0443\u0448\u043a\u0438\u043d\u0441\u043a\u0443\u044e. \u0422\u0432\u0435\u0440\u0441\u043a\u043e\u0439 \u0431\u0443\u043b\u044c\u0432\u0430\u0440 \u0437\u0430\u043b\u043e\u0436\u0438\u043b\u0438 \u0432 1796 \u0433\u043e\u0434\u0443: \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u0441\u0442\u0430\u043b \u0446\u0435\u043d\u0442\u0440\u043e\u043c \u0441\u0432\u0435\u0442\u0441\u043a\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u0434\u0432\u043e\u0440\u044f\u043d. \u0411\u044b\u0432\u0430\u043b \u0437\u0434\u0435\u0441\u044c \u0438 \u041f\u0443\u0448\u043a\u0438\u043d: \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0422\u0432\u0435\u0440\u0441\u043a\u043e\u043c \u0431\u0443\u043b\u044c\u0432\u0430\u0440\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u044f\u043b \u043f\u0430\u043c\u044f\u0442\u043d\u0438\u043a \u043f\u043e\u044d\u0442\u0443, \u043f\u043e\u043a\u0430 \u0432 1950 \u0433\u043e\u0434\u0443 \u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u043b\u0438 \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u044e\u044e \u041f\u0443\u0448\u043a\u0438\u043d\u0441\u043a\u0443\u044e \u043f\u043b\u043e\u0449\u0430\u0434\u044c. \n", "region": "5d08e36dad3a9a001701b95b", "is_priority": false, "sort": 60, "tags": ["6124b391020892001197dfcf"], "cg_recommendations": [], "place": ["61c079d3c53ae811d6e6b8db"], "restaurants": [], "city": "5bbe8a8a9e7fcb000f78a92d", "event_type": "5ebe69313740700019205cfe", "title": "\u0422\u0432\u0435\u0440\u0441\u043a\u043e\u0439 \u0431\u0443\u043b\u044c\u0432\u0430\u0440", "import_denied": false}}]
|
1
data/concerts.json
Normal file
1
data/concerts.json
Normal file
File diff suppressed because one or more lines are too long
1
data/dostoprimechatelnosti.json
Normal file
1
data/dostoprimechatelnosti.json
Normal file
File diff suppressed because one or more lines are too long
BIN
data/events.zip
BIN
data/events.zip
Binary file not shown.
1
data/excursii.json
Normal file
1
data/excursii.json
Normal file
File diff suppressed because one or more lines are too long
1
data/images.json
Normal file
1
data/images.json
Normal file
File diff suppressed because one or more lines are too long
1
data/kino.json
Normal file
1
data/kino.json
Normal file
File diff suppressed because one or more lines are too long
1
data/museum.json
Normal file
1
data/museum.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"_id": {"$oid": "64107fe599c33f2daae19203"}, "dictionary_data": {"youtube_videos": [], "russpass_recommendation": false, "aac_images": [], "parser_source": "LKP", "disable_sessionids_autoupdate": false, "information_pages": [], "type_audio_guide": [], "sessionIds": [], "social_buttons": [], "partner": "63ff5a8fd40834b15998dcf9", "images": [], "image_explore_preview": [{"source": {"id": "6422a74bcfc508abfb3fe7e8"}}, {"source": {"id": "6422a750cfc508abfb3fe7f8"}}, {"source": {"id": "6422a758cfc508abfb3fe804"}}], "image_detailed_page_main": [], "tags_main_screen": [], "aac_tags": [], "duration": "60", "ticket_price": "500", "is_can_buy": true, "galereya": [], "recommendation_prime": [], "age": "0+", "timetable_by_place": [], "schedule": [], "without_schedule": false, "description": "\u0412 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0430\u0440\u0444\u044e\u043c\u0435\u0440\u043d\u043e\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438\u00bb \u0434\u0443\u0445\u0438 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u043d\u043e \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0433\u0435\u0440\u043e\u044f\u043c\u0438 \u0441\u043f\u0435\u043a\u0442\u0430\u043a\u043b\u0435\u0439. \u0422\u0430\u043a\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f - \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0438\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u0430\u0440\u043e\u043c\u0430\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u0442\u0430\u0451\u043d\u043d\u044b\u0435 \u0437\u043e\u043d\u044b \u0434\u0443\u0448\u0438 \u0438 \u0442\u0435\u043b\u0430, \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u044f \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044e, \u043e\u0436\u0438\u0432\u043b\u044f\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u043e\u043d\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435, \u0441\u043b\u0443\u0445\u043e\u0432\u044b\u0435 \u0438 \u0442\u0430\u043a\u0442\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b. \u041f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0444\u044e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u043a\u0440\u0443\u0433\u043e\u0437\u043e\u0440\u0430 \u0438 \u0441\u043f\u0435\u043a\u0442\u0440\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043c\u0438\u0440\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c. ", "is_priority": false, "tags": [], "cg_recommendations": [], "place": ["641081162a94483af923a496"], "restaurants": [], "city": "5bbf0e5f729bd4000fe02d5e", "event_type": "63eb49a688c02c9c01208394", "title": "\u0422\u0435\u0430\u0442\u0440 \u0430\u0440\u043e\u043c\u0430\u0442\u043e\u0432", "import_denied": false}}]
|
1
data/spektatli.json
Normal file
1
data/spektatli.json
Normal file
File diff suppressed because one or more lines are too long
1
data/teatr.json
Normal file
1
data/teatr.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"_id": {"$oid": "64107fe599c33f2daae19203"}, "dictionary_data": {"youtube_videos": [], "russpass_recommendation": false, "aac_images": [], "parser_source": "LKP", "disable_sessionids_autoupdate": false, "information_pages": [], "type_audio_guide": [], "sessionIds": [], "social_buttons": [], "partner": "63ff5a8fd40834b15998dcf9", "images": [], "image_explore_preview": [{"source": {"id": "6422a74bcfc508abfb3fe7e8"}}, {"source": {"id": "6422a750cfc508abfb3fe7f8"}}, {"source": {"id": "6422a758cfc508abfb3fe804"}}], "image_detailed_page_main": [], "tags_main_screen": [], "aac_tags": [], "duration": "60", "ticket_price": "500", "is_can_buy": true, "galereya": [], "recommendation_prime": [], "age": "0+", "timetable_by_place": [], "schedule": [], "without_schedule": false, "description": "\u0412 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0430\u0440\u0444\u044e\u043c\u0435\u0440\u043d\u043e\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438\u00bb \u0434\u0443\u0445\u0438 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u043d\u043e \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0433\u0435\u0440\u043e\u044f\u043c\u0438 \u0441\u043f\u0435\u043a\u0442\u0430\u043a\u043b\u0435\u0439. \u0422\u0430\u043a\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f - \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0438\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u0430\u0440\u043e\u043c\u0430\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u0442\u0430\u0451\u043d\u043d\u044b\u0435 \u0437\u043e\u043d\u044b \u0434\u0443\u0448\u0438 \u0438 \u0442\u0435\u043b\u0430, \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u044f \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044e, \u043e\u0436\u0438\u0432\u043b\u044f\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u043e\u043d\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435, \u0441\u043b\u0443\u0445\u043e\u0432\u044b\u0435 \u0438 \u0442\u0430\u043a\u0442\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b. \u041f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0444\u044e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u043a\u0440\u0443\u0433\u043e\u0437\u043e\u0440\u0430 \u0438 \u0441\u043f\u0435\u043a\u0442\u0440\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043c\u0438\u0440\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c. ", "is_priority": false, "tags": [], "cg_recommendations": [], "place": ["641081162a94483af923a496"], "restaurants": [], "city": "5bbf0e5f729bd4000fe02d5e", "event_type": "63eb49a688c02c9c01208394", "title": "\u0422\u0435\u0430\u0442\u0440 \u0430\u0440\u043e\u043c\u0430\u0442\u043e\u0432", "import_denied": false}}]
|
1
data/yarmarki.json
Normal file
1
data/yarmarki.json
Normal file
File diff suppressed because one or more lines are too long
89
parsers/bulvari.py
Normal file
89
parsers/bulvari.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/bulvary.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
info = r["dictionary_data"]
|
||||
d["type"] = "boulevard"
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if info["region"]:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
print(d)
|
||||
|
||||
|
||||
def get_bulvari():
|
||||
return result
|
27
parsers/city.py
Normal file
27
parsers/city.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
with open("data/cities.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
d = {}
|
||||
info = r["dictionary_data"]
|
||||
d["id"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
if "region" in info:
|
||||
d["region"] = info["region"]
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
|
||||
result.append(d)
|
||||
|
||||
|
||||
def get_cities():
|
||||
return result
|
89
parsers/concert.py
Normal file
89
parsers/concert.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/concerts.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "concert"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_concert():
|
||||
return result
|
89
parsers/dostoprimechatelnost.py
Normal file
89
parsers/dostoprimechatelnost.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/dostoprimechatelnosti.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "attraction"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if info["region"]:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_dostoprimechatelnost():
|
||||
return result
|
89
parsers/excursii.py
Normal file
89
parsers/excursii.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/excursii.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "excursion"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_excursion():
|
||||
return result
|
89
parsers/movie.py
Normal file
89
parsers/movie.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/kino.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "movie"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_movie():
|
||||
return result
|
89
parsers/museum.py
Normal file
89
parsers/museum.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/museum.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "museum"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_museum():
|
||||
return result
|
50
parsers/place.py
Normal file
50
parsers/place.py
Normal file
|
@ -0,0 +1,50 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region
|
||||
|
||||
with open("data/places.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
d = {}
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
if "description" in info:
|
||||
d["description"] = info["description"]
|
||||
if "working_time" in info:
|
||||
d["working_time"] = info["working_time"]
|
||||
else:
|
||||
d["description"] = ""
|
||||
if "address" in info:
|
||||
d["address"] = info["address"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"][0])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
if "sites" in info:
|
||||
d["sites"] = info["sites"]
|
||||
if "phones" in info:
|
||||
d["phones"] = info["phones"]
|
||||
|
||||
result.append(d)
|
||||
|
||||
|
||||
def get_places():
|
||||
return result
|
89
parsers/plays.py
Normal file
89
parsers/plays.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/spektatli.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "plays"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_spektatli():
|
||||
return result
|
39
parsers/regions.py
Normal file
39
parsers/regions.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
with open("data/regions.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
reg = {}
|
||||
region = r["dictionary_data"]
|
||||
reg["id"] = r["_id"]["$oid"]
|
||||
if region["city"]:
|
||||
reg["city"] = region["city"][0]
|
||||
|
||||
reg["title"] = region["title"]
|
||||
reg["url"] = region["url"]
|
||||
reg["description"] = region["description"]
|
||||
reg["description_title"] = region["description_title"]
|
||||
reg["description_short"] = region["short_description"]
|
||||
reg["showcase_cards"] = region["showcase_cards"]
|
||||
media = []
|
||||
for m in region["gallery"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in region["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in region["icon"]:
|
||||
media.append({"file": m["source"]["id"], "type": "icon"})
|
||||
|
||||
if media:
|
||||
reg["media"] = media
|
||||
|
||||
result.append(reg)
|
||||
|
||||
|
||||
def get_regions():
|
||||
return result
|
89
parsers/theatre.py
Normal file
89
parsers/theatre.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/teatr.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "theatre"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if "region" in info:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
pprint(d)
|
||||
|
||||
|
||||
def get_theatre():
|
||||
return result
|
89
parsers/yarmarka.py
Normal file
89
parsers/yarmarka.py
Normal file
|
@ -0,0 +1,89 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
from django.contrib.gis.geos import Point
|
||||
|
||||
from passfinder.events.models import City, Region, Place
|
||||
|
||||
with open("data/yarmarki.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
result = []
|
||||
for r in data:
|
||||
al = True
|
||||
d = {}
|
||||
d["type"] = "fair"
|
||||
info = r["dictionary_data"]
|
||||
d["oid"] = r["_id"]["$oid"]
|
||||
d["title"] = info["title"]
|
||||
d["description"] = info["description"]
|
||||
if "parser_source" in info:
|
||||
d["parser_source"] = info["parser_source"]
|
||||
if "sort" in info:
|
||||
d["sort"] = int(info["sort"])
|
||||
if "is_can_buy" in info:
|
||||
d["can_buy"] = info["is_can_buy"]
|
||||
if "priority" in info:
|
||||
d["priority"] = int(info["priority"])
|
||||
if "duration" in info:
|
||||
d["duration"] = int(info["duration"])
|
||||
if "ticket_price" in info:
|
||||
d["ticket_price"] = int(info["ticket_price"])
|
||||
if "schedule" in info:
|
||||
d["schedule"] = info["schedule"]
|
||||
|
||||
if "payment_method" in info:
|
||||
d["payment_method"] = info["payment_method"]
|
||||
elif "purchase_method" in info:
|
||||
d["payment_method"] = info["purchase_method"]
|
||||
if "age" in info:
|
||||
d["age"] = info["age"]
|
||||
if "booking_link" in info:
|
||||
d["booking_link"] = info["booking_link"]
|
||||
if "discover_moscow_link" in info:
|
||||
d["discover_moscow_link"] = info["discover_moscow_link"]
|
||||
if info["city"]:
|
||||
try:
|
||||
d["city"] = City.objects.get(oid=info["city"])
|
||||
except City.DoesNotExist:
|
||||
...
|
||||
if info["region"]:
|
||||
try:
|
||||
d["region"] = Region.objects.get(oid=info["region"])
|
||||
except Region.DoesNotExist:
|
||||
...
|
||||
if info["place"]:
|
||||
try:
|
||||
d["place"] = Place.objects.get(oid=info["place"][0])
|
||||
except Place.DoesNotExist:
|
||||
...
|
||||
|
||||
if "geo_data" in info and info["geo_data"]["coordinates"]:
|
||||
d["location"] = Point(
|
||||
info["geo_data"]["coordinates"][0], info["geo_data"]["coordinates"][1]
|
||||
)
|
||||
else:
|
||||
if "place" in d:
|
||||
d["location"] = d["place"].location
|
||||
else:
|
||||
al = False
|
||||
|
||||
media = []
|
||||
for m in info["images"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
for m in info["galereya"]:
|
||||
media.append({"file": m["source"]["id"], "type": "image"})
|
||||
|
||||
if media:
|
||||
d["media"] = media
|
||||
|
||||
if al:
|
||||
result.append(d)
|
||||
else:
|
||||
print(d)
|
||||
|
||||
|
||||
def get_yarmarka():
|
||||
return result
|
|
@ -1,16 +1,12 @@
|
|||
import os
|
||||
|
||||
from passfinder.common.tasks import crop_model_image
|
||||
{ % - if cookiecutter.use_celery != "y" %}
|
||||
from passfinder.utils.files import crop_image
|
||||
{ % - endif %}
|
||||
|
||||
|
||||
def create_cropped_model_image(sender, instance, created, **kwargs):
|
||||
model = sender
|
||||
if created:
|
||||
if instance.image:
|
||||
{ % - if cookiecutter.use_celery == "y" %}
|
||||
crop_model_image.apply_async(
|
||||
kwargs={
|
||||
"pk": instance.pk,
|
||||
|
@ -19,14 +15,7 @@ def create_cropped_model_image(sender, instance, created, **kwargs):
|
|||
},
|
||||
countdown=2,
|
||||
)
|
||||
{ % - else - %}
|
||||
instance.image_cropped.save(
|
||||
instance.image.path.split(".")[0].split("/")[-1] + ".png",
|
||||
File(crop_image(instance.image.path, length=250)),
|
||||
save=False,
|
||||
)
|
||||
instance.save(update_fields=["image_cropped"])
|
||||
{ % - endif %}
|
||||
|
||||
|
||||
def update_cropped_model_image(sender, instance, **kwargs):
|
||||
|
@ -41,7 +30,6 @@ def update_cropped_model_image(sender, instance, **kwargs):
|
|||
# run task to create new cropped image
|
||||
if kwargs["update_fields"] != frozenset({"image_cropped"}) and instance:
|
||||
if instance.image:
|
||||
{ % - if cookiecutter.use_celery == "y" %}
|
||||
crop_model_image.apply_async(
|
||||
kwargs={
|
||||
"pk": instance.pk,
|
||||
|
@ -50,14 +38,6 @@ def update_cropped_model_image(sender, instance, **kwargs):
|
|||
},
|
||||
countdown=2,
|
||||
)
|
||||
{ % - else - %}
|
||||
instance.image_cropped.save(
|
||||
instance.image.path.split(".")[0].split("/")[-1] + ".png",
|
||||
File(crop_image(instance.image.path, length=250)),
|
||||
save=False,
|
||||
)
|
||||
instance.save(update_fields=["image_cropped"])
|
||||
{ % - endif %}
|
||||
else:
|
||||
instance.image_cropped = None
|
||||
|
||||
|
|
0
passfinder/events/api/__init__.py
Normal file
0
passfinder/events/api/__init__.py
Normal file
31
passfinder/events/api/serializers.py
Normal file
31
passfinder/events/api/serializers.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
from rest_framework import serializers
|
||||
|
||||
from passfinder.events.models import Hotel, HotelPhone, City
|
||||
|
||||
|
||||
class HotelPhoneSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = HotelPhone
|
||||
exclude = "hotel"
|
||||
|
||||
|
||||
class CitySerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = City
|
||||
|
||||
|
||||
class HotelSerializer(serializers.ModelSerializer):
|
||||
phones = HotelPhoneSerializer(many=True)
|
||||
source = serializers.CharField(source="parser_source")
|
||||
|
||||
class Meta:
|
||||
model = Hotel
|
||||
exclude = ("oid", "parser_source")
|
||||
|
||||
|
||||
class MuseumSerializer(serializers.ModelSerializer):
|
||||
phones = HotelPhoneSerializer(many=True)
|
||||
|
||||
class Meta:
|
||||
model = Hotel
|
||||
exclude = "oid"
|
|
@ -0,0 +1,121 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 09:38
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import location_field.models.plain
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="RegionMedia",
|
||||
fields=[
|
||||
(
|
||||
"oid",
|
||||
models.CharField(max_length=24, primary_key=True, serialize=False),
|
||||
),
|
||||
("file", models.FileField(upload_to="uploads/")),
|
||||
("type", models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="Country",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="hotel",
|
||||
name="location",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="restaurant",
|
||||
name="location",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="basepoint",
|
||||
name="location",
|
||||
field=location_field.models.plain.PlainLocationField(
|
||||
default=0, max_length=63
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="event",
|
||||
name="type",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("fair", "ярмарка"),
|
||||
("boulevard", "бульвар"),
|
||||
("attraction", "достопримечательность"),
|
||||
("excursion", "экскурсия"),
|
||||
("theatre", "театр"),
|
||||
("museum", "музей"),
|
||||
("movie", "кино"),
|
||||
("concert", "концерт"),
|
||||
("plays", "спектакли"),
|
||||
],
|
||||
db_index=True,
|
||||
default="fair",
|
||||
max_length=10,
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="region",
|
||||
name="city",
|
||||
field=models.ForeignKey(
|
||||
default=1,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="regions",
|
||||
to="events.city",
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="region",
|
||||
name="description",
|
||||
field=models.TextField(default="dd"),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="region",
|
||||
name="description_short",
|
||||
field=models.CharField(default="ewfew", max_length=500),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="region",
|
||||
name="description_title",
|
||||
field=models.CharField(default="sdf", max_length=250),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="region",
|
||||
name="showcase_cards",
|
||||
field=models.JSONField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="region",
|
||||
name="url",
|
||||
field=models.URLField(default="f"),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="Museum",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="regionmedia",
|
||||
name="region",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="media",
|
||||
to="events.region",
|
||||
),
|
||||
),
|
||||
]
|
24
passfinder/events/migrations/0003_alter_region_city.py
Normal file
24
passfinder/events/migrations/0003_alter_region_city.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 09:42
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0002_regionmedia_delete_country_remove_hotel_location_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="region",
|
||||
name="city",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="regions",
|
||||
to="events.city",
|
||||
),
|
||||
),
|
||||
]
|
22
passfinder/events/migrations/0004_city_location.py
Normal file
22
passfinder/events/migrations/0004_city_location.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 09:59
|
||||
|
||||
from django.db import migrations
|
||||
import location_field.models.plain
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0003_alter_region_city"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="city",
|
||||
name="location",
|
||||
field=location_field.models.plain.PlainLocationField(
|
||||
default=0, max_length=63
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -0,0 +1,30 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:13
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0004_city_location"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="place",
|
||||
name="region",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="places",
|
||||
to="events.region",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="place",
|
||||
name="title",
|
||||
field=models.CharField(default="", max_length=250),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:17
|
||||
|
||||
import django.contrib.postgres.fields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0005_place_region_place_title"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="place",
|
||||
name="phones",
|
||||
field=django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.CharField(max_length=250), null=True, size=None
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="place",
|
||||
name="sites",
|
||||
field=django.contrib.postgres.fields.ArrayField(
|
||||
base_field=models.CharField(max_length=250), null=True, size=None
|
||||
),
|
||||
),
|
||||
]
|
18
passfinder/events/migrations/0007_alter_place_address.py
Normal file
18
passfinder/events/migrations/0007_alter_place_address.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0006_alter_place_phones_alter_place_sites"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="place",
|
||||
name="address",
|
||||
field=models.CharField(blank=True, max_length=250, null=True),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,72 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:24
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0007_alter_place_address"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="basepoint",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="city",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="place",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="pointmedia",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="region",
|
||||
name="description_title",
|
||||
field=models.CharField(max_length=500),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="region",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="region",
|
||||
name="title",
|
||||
field=models.CharField(max_length=500),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="regionmedia",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tag",
|
||||
name="oid",
|
||||
field=models.CharField(
|
||||
max_length=24, primary_key=True, serialize=False, unique=True
|
||||
),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,97 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:47
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0008_alter_basepoint_oid_alter_city_oid_alter_place_oid_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="basepoint",
|
||||
name="creator",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="basepoint",
|
||||
name="partner",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="basepoint",
|
||||
name="payment_method",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="event",
|
||||
name="ya_id",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="basepoint",
|
||||
name="can_buy",
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="basepoint",
|
||||
name="place",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="points",
|
||||
to="events.place",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="basepoint",
|
||||
name="priority",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="basepoint",
|
||||
name="sort",
|
||||
field=models.IntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="event",
|
||||
name="payment_method",
|
||||
field=models.CharField(default="", max_length=250),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="event",
|
||||
name="purchase_method",
|
||||
field=models.CharField(default="", max_length=250),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="event",
|
||||
name="age",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
max_length=50,
|
||||
null=True,
|
||||
verbose_name="Возрастное ограничение",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="event",
|
||||
name="booking_link",
|
||||
field=models.URLField(blank=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="event",
|
||||
name="discover_moscow_link",
|
||||
field=models.URLField(blank=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="region",
|
||||
name="description_title",
|
||||
field=models.CharField(max_length=250),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="region",
|
||||
name="title",
|
||||
field=models.CharField(max_length=250),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0009_remove_basepoint_creator_remove_basepoint_partner_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="basepoint",
|
||||
name="parser_source",
|
||||
field=models.CharField(blank=True, max_length=250, null=True),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,22 @@
|
|||
# Generated by Django 4.2.1 on 2023-05-20 12:58
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0010_alter_basepoint_parser_source"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="event",
|
||||
name="purchase_method",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="event",
|
||||
name="payment_method",
|
||||
field=models.CharField(blank=True, max_length=250, null=True),
|
||||
),
|
||||
]
|
|
@ -2,27 +2,35 @@
|
|||
from django.db import models
|
||||
from location_field.models.plain import PlainLocationField
|
||||
from polymorphic.models import PolymorphicModel
|
||||
from passfinder.utils.choices import count_max_length
|
||||
|
||||
|
||||
class OIDModel(models.Model):
|
||||
oid = models.CharField(primary_key=True, max_length=24)
|
||||
oid = models.CharField(primary_key=True, max_length=24, unique=True)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
class Region(OIDModel):
|
||||
city = models.ForeignKey(
|
||||
"City", null=True, related_name="regions", on_delete=models.CASCADE
|
||||
)
|
||||
title = models.CharField(max_length=250)
|
||||
description = models.TextField()
|
||||
description_title = models.CharField(max_length=250)
|
||||
description_short = models.CharField(max_length=500)
|
||||
url = models.URLField()
|
||||
showcase_cards = models.JSONField(null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
class Country(OIDModel):
|
||||
title = models.CharField(max_length=250)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
class RegionMedia(OIDModel):
|
||||
file = models.FileField(upload_to="uploads/")
|
||||
type = models.CharField(max_length=200)
|
||||
region = models.ForeignKey("Region", related_name="media", on_delete=models.CASCADE)
|
||||
|
||||
|
||||
class City(OIDModel):
|
||||
|
@ -30,21 +38,26 @@ class City(OIDModel):
|
|||
region = models.ForeignKey(
|
||||
"Region", related_name="cities", null=True, on_delete=models.SET_NULL
|
||||
)
|
||||
location = PlainLocationField(zoom=6)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
class Place(OIDModel):
|
||||
address = models.CharField(max_length=250)
|
||||
address = models.CharField(max_length=250, null=True, blank=True)
|
||||
parser_source = models.CharField(max_length=250)
|
||||
city = models.ForeignKey(
|
||||
"City", related_name="places", null=True, on_delete=models.SET_NULL
|
||||
)
|
||||
region = models.ForeignKey(
|
||||
"Region", related_name="places", null=True, on_delete=models.SET_NULL
|
||||
)
|
||||
title = models.CharField(max_length=250)
|
||||
description = models.TextField()
|
||||
location = PlainLocationField(zoom=6)
|
||||
sites = ArrayField(models.CharField(max_length=250))
|
||||
phones = ArrayField(models.CharField(max_length=250))
|
||||
sites = ArrayField(models.CharField(max_length=250), null=True)
|
||||
phones = ArrayField(models.CharField(max_length=250), null=True)
|
||||
working_time = models.JSONField(null=True)
|
||||
|
||||
|
||||
|
@ -57,7 +70,7 @@ def __str__(self):
|
|||
|
||||
class BasePoint(OIDModel, PolymorphicModel):
|
||||
title = models.CharField(max_length=250)
|
||||
parser_source = models.CharField(max_length=250)
|
||||
parser_source = models.CharField(max_length=250, null=True, blank=True)
|
||||
description = models.TextField()
|
||||
city = models.ForeignKey(
|
||||
"City", related_name="points", null=True, on_delete=models.SET_NULL
|
||||
|
@ -65,10 +78,13 @@ class BasePoint(OIDModel, PolymorphicModel):
|
|||
region = models.ForeignKey(
|
||||
"Region", related_name="points", null=True, on_delete=models.SET_NULL
|
||||
)
|
||||
creator = models.CharField(max_length=250)
|
||||
partner = models.CharField(max_length=250)
|
||||
payment_method = models.CharField(max_length=250)
|
||||
# tags = models.ManyToManyField("Tag", related_name="points")
|
||||
place = models.ForeignKey(
|
||||
"Place", related_name="points", null=True, on_delete=models.SET_NULL
|
||||
)
|
||||
sort = models.IntegerField(default=0)
|
||||
location = PlainLocationField(zoom=6)
|
||||
can_buy = models.BooleanField(default=True)
|
||||
priority = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
@ -83,10 +99,28 @@ class PointMedia(OIDModel):
|
|||
|
||||
|
||||
class Event(BasePoint):
|
||||
ya_id = models.CharField(blank=True, max_length=24)
|
||||
age = models.CharField("Возрастное ограничение", max_length=50)
|
||||
booking_link = models.URLField()
|
||||
discover_moscow_link = models.URLField()
|
||||
class EventType(models.TextChoices):
|
||||
yarmarka = "fair", "ярмарка"
|
||||
bulvar = "boulevard", "бульвар"
|
||||
dostoprimechatelnost = "attraction", "достопримечательность"
|
||||
excursii = "excursion", "экскурсия"
|
||||
teatr = "theatre", "театр"
|
||||
museum = "museum", "музей"
|
||||
kino = "movie", "кино"
|
||||
concert = "concert", "концерт"
|
||||
spektatli = "plays", "спектакли"
|
||||
|
||||
payment_method = models.CharField(max_length=250, null=True, blank=True)
|
||||
type = models.CharField(
|
||||
db_index=True,
|
||||
choices=EventType.choices,
|
||||
max_length=count_max_length(EventType),
|
||||
)
|
||||
age = models.CharField(
|
||||
"Возрастное ограничение", max_length=50, blank=True, null=True
|
||||
)
|
||||
booking_link = models.URLField(null=True, blank=True)
|
||||
discover_moscow_link = models.URLField(null=True, blank=True)
|
||||
duration = models.IntegerField(blank=True, null=True)
|
||||
ticket_price = models.IntegerField(blank=True, null=True)
|
||||
schedule = models.JSONField(null=True)
|
||||
|
@ -94,7 +128,6 @@ class Event(BasePoint):
|
|||
|
||||
class Hotel(BasePoint):
|
||||
address = models.CharField(max_length=250)
|
||||
location = PlainLocationField(zoom=6)
|
||||
rooms = models.JSONField(null=True)
|
||||
email = models.CharField(max_length=250)
|
||||
stars = models.IntegerField(null=True)
|
||||
|
@ -106,11 +139,6 @@ class HotelPhone(models.Model):
|
|||
number = models.CharField(max_length=18)
|
||||
|
||||
|
||||
class Museum(BasePoint):
|
||||
# TODO
|
||||
...
|
||||
|
||||
|
||||
class Excursion(BasePoint):
|
||||
duration_hours = models.IntegerField()
|
||||
price = models.IntegerField()
|
||||
|
@ -131,5 +159,4 @@ class Restaurant(BasePoint):
|
|||
avg_time_visit = models.IntegerField()
|
||||
can_reserve = models.BooleanField()
|
||||
working_time = models.JSONField(null=True)
|
||||
location = PlainLocationField(zoom=6)
|
||||
phone = models.CharField(max_length=18)
|
||||
|
|
Loading…
Reference in New Issue
Block a user