From 07499c7b3fee1e5f8890c6e3cab9551bca56a588 Mon Sep 17 00:00:00 2001 From: littlewolf Date: Wed, 13 Nov 2019 00:19:47 +0300 Subject: [PATCH] Tmp fix --- apps/collection/models.py | 2 +- apps/location/transfer_data.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/apps/collection/models.py b/apps/collection/models.py index a051a5c1..f37ea4d6 100644 --- a/apps/collection/models.py +++ b/apps/collection/models.py @@ -76,7 +76,7 @@ class Collection(ProjectBaseMixin, CollectionDateMixin, slug = models.SlugField(max_length=50, unique=True, verbose_name=_('Collection slug'), editable=True, null=True) - old_id=models.IntegerField(null=True, blank=True) + old_id = models.IntegerField(null=True, blank=True) objects = CollectionQuerySet.as_manager() class Meta: diff --git a/apps/location/transfer_data.py b/apps/location/transfer_data.py index ca34f987..bd8a97e2 100644 --- a/apps/location/transfer_data.py +++ b/apps/location/transfer_data.py @@ -5,6 +5,7 @@ from transfer.models import Cities, Locations, CityPhotos from pprint import pprint from requests import get +import json def transfer_countries(): @@ -185,6 +186,21 @@ def migrate_city_photos(): pprint(f"Address serializer errors: {serialized_data.errors}") +def update_subregions(): + # regions = CitySerializer + pass + + +# TODO: удалить после переноса! +def get_ruby_socket(region_params): + url = 'http://172.22.0.1:5678' + response = get(url, params=region_params) + + data = json.loads(response.text) + print(data) + return data + + data_types = { "dictionaries": [ transfer_countries, @@ -200,6 +216,7 @@ data_types = { ], "migrate_city_gallery": [ migrate_city_photos - ] + ], + "tmp": [update_subregions] }