|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
@ -1 +1 @@
|
||||
[{"model": "auth.group", "pk": 1, "fields": {"name": "Администратор пользователей", "permissions": [13, 14, 15, 16]}}, {"model": "auth.group", "pk": 2, "fields": {"name": "Зритель", "permissions": [28]}}, {"model": "auth.group", "pk": 3, "fields": {"name": "Редактор", "permissions": [25, 26, 27, 28]}}]
|
||||
[{"model": "auth.group", "pk": 1, "fields": {"name": "Зритель", "permissions": [["view_placementpoint", "service", "placementpoint"]]}}, {"model": "auth.group", "pk": 2, "fields": {"name": "Редактор", "permissions": [["add_placementpoint", "service", "placementpoint"], ["change_placementpoint", "service", "placementpoint"], ["delete_placementpoint", "service", "placementpoint"], ["view_placementpoint", "service", "placementpoint"]]}}, {"model": "auth.group", "pk": 3, "fields": {"name": "Администратор пользователей", "permissions": [["add_user", "auth", "user"], ["change_user", "auth", "user"], ["delete_user", "auth", "user"], ["view_user", "auth", "user"]]}}]
|
||||
@ -0,0 +1,186 @@
|
||||
[
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 4,
|
||||
"fields": {
|
||||
"name": "business_activity",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 5,
|
||||
"fields": {
|
||||
"name": "metro_stations",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 22,
|
||||
"fields": {
|
||||
"name": "bargains",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 23,
|
||||
"fields": {
|
||||
"name": "BC",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 24,
|
||||
"fields": {
|
||||
"name": "flats_cnt",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 25,
|
||||
"fields": {
|
||||
"name": "offers_estate",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 26,
|
||||
"fields": {
|
||||
"name": "schools",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 27,
|
||||
"fields": {
|
||||
"name": "kindergar",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 28,
|
||||
"fields": {
|
||||
"name": "stops",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 29,
|
||||
"fields": {
|
||||
"name": "pharmacies",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 30,
|
||||
"fields": {
|
||||
"name": "sport_centers",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 31,
|
||||
"fields": {
|
||||
"name": "supermarkets",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 32,
|
||||
"fields": {
|
||||
"name": "supermarkets_premium",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 33,
|
||||
"fields": {
|
||||
"name": "banks",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 34,
|
||||
"fields": {
|
||||
"name": "recas",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 35,
|
||||
"fields": {
|
||||
"name": "labs",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 36,
|
||||
"fields": {
|
||||
"name": "clinics",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 37,
|
||||
"fields": {
|
||||
"name": "attractions",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 38,
|
||||
"fields": {
|
||||
"name": "cultures",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 39,
|
||||
"fields": {
|
||||
"name": "public_services",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 40,
|
||||
"fields": {
|
||||
"name": "popul_home_job",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 41,
|
||||
"fields": {
|
||||
"name": "TC",
|
||||
"visible": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.otherobjectscategory",
|
||||
"pk": 42,
|
||||
"fields": {
|
||||
"name": "yndx_food_cnt_amt",
|
||||
"visible": false
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,23 @@
|
||||
[{"model": "service.otherobjectsgroup", "pk": 4, "fields": {"name": "business_activity", "category": 4, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 5, "fields": {"name": "metro_stations", "category": 5, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 23, "fields": {"name": "bargains", "category": 22, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 24, "fields": {"name": "BC", "category": 23, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 25, "fields": {"name": "flats_cnt", "category": 24, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 26, "fields": {"name": "offers_estate", "category": 25, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 27, "fields": {"name": "schools", "category": 26, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 28, "fields": {"name": "kindergar", "category": 27, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 29, "fields": {"name": "stops", "category": 28, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 30, "fields": {"name": "pharmacies", "category": 29, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 31, "fields": {"name": "sport_centers", "category": 30, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 32, "fields": {"name": "supermarkets", "category": 31, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 33, "fields": {"name": "supermarkets_premium", "category": 32, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 34, "fields": {"name": "banks", "category": 33, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 35, "fields": {"name": "recas", "category": 34, "image": "", "visible": false}}, {
|
||||
"model": "service.otherobjectsgroup", "pk": 36, "fields": {"name": "labs", "category": 35, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 37, "fields": {"name": "clinics", "category": 36, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 38, "fields": {"name": "attractions", "category": 37, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 39, "fields": {"name": "cultures", "category": 38, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 40, "fields": {"name": "public_services", "category": 39, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 41, "fields": {"name": "popul_home_job", "category": 40, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 42, "fields": {"name": "TC", "category": 41, "image": "", "visible": false}},
|
||||
{"model": "service.otherobjectsgroup", "pk": 43, "fields": {"name": "yndx_food_cnt_amt", "category": 42, "image": "", "visible": false}}]
|
||||
@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"model": "service.post_and_pvzcategory",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"name": "ПВЗ",
|
||||
"visible": true,
|
||||
"include_in_ml": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "service.post_and_pvzcategory",
|
||||
"pk": 2,
|
||||
"fields": {
|
||||
"name": "Постаматы прочих сетей",
|
||||
"visible": true,
|
||||
"include_in_ml": true
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,112 @@
|
||||
[
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":7,
|
||||
"fields":{
|
||||
"name":"Ozon",
|
||||
"category":1,
|
||||
"image":"post_and_pvz_group_images/nameozon_typePVZ_SizeM.png",
|
||||
"visible":true,
|
||||
"include_in_ml":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":8,
|
||||
"fields":{
|
||||
"name":"СДЭК",
|
||||
"category":1,
|
||||
"image":"post_and_pvz_group_images/namesdek_typePVZ_SizeM.png",
|
||||
"visible":true,
|
||||
"include_in_ml":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":9,
|
||||
"fields":{
|
||||
"name":"Халва",
|
||||
"category":2,
|
||||
"image":"post_and_pvz_group_images/namekhalva_typepostamat_SizeM.png",
|
||||
"visible":true,
|
||||
"include_in_ml":false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":10,
|
||||
"fields":{
|
||||
"name":"СДЭК",
|
||||
"category":2,
|
||||
"image":"post_and_pvz_group_images/namesdek_typepostamat_SizeM.png",
|
||||
"visible":true,
|
||||
"include_in_ml":false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":12,
|
||||
"fields":{
|
||||
"name":"Ozon",
|
||||
"category":2,
|
||||
"image":"post_and_pvz_group_images/nameozon_typepostamat_SizeM.png",
|
||||
"visible":true,
|
||||
"include_in_ml":false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":17,
|
||||
"fields":{
|
||||
"name":"WildBerries",
|
||||
"category":1,
|
||||
"image":"post_and_pvz_group_images/namewb_typePVZ_SizeM.png",
|
||||
"visible":true,
|
||||
"include_in_ml":false
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":19,
|
||||
"fields":{
|
||||
"name":"Яндекс.Маркет",
|
||||
"category":1,
|
||||
"image":"post_and_pvz_group_images/ya.market-PVZ-M_KWksDvo.png",
|
||||
"visible":true,
|
||||
"include_in_ml":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":20,
|
||||
"fields":{
|
||||
"name":"Яндекс.Маркет",
|
||||
"category":2,
|
||||
"image":"post_and_pvz_group_images/ya.market-postamat-M.png",
|
||||
"visible":true,
|
||||
"include_in_ml":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":24,
|
||||
"fields":{
|
||||
"name":"Почта России",
|
||||
"category":1,
|
||||
"image":"post_and_pvz_group_images/pochta-PVZ-M.png",
|
||||
"visible":true,
|
||||
"include_in_ml":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"model":"service.post_and_pvzgroup",
|
||||
"pk":25,
|
||||
"fields":{
|
||||
"name":"Почта России",
|
||||
"category":2,
|
||||
"image":"post_and_pvz_group_images/pochta-postamat-M_gBJlHTO.png",
|
||||
"visible":true,
|
||||
"include_in_ml":true
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,44 @@
|
||||
from django.contrib.gis.measure import Distance
|
||||
from service import models
|
||||
from postamates.settings import DEFAULT_PLACEMENT_POINT_UPDATE_RADIUS
|
||||
|
||||
|
||||
class LayerService:
|
||||
def count_post_pvz_for_placementpoint(self, obj):
|
||||
points = models.PlacementPoint.objects.filter(geometry__distance_lt=(obj.wkt, Distance(
|
||||
m=DEFAULT_PLACEMENT_POINT_UPDATE_RADIUS))).all()
|
||||
for point in points:
|
||||
LayerService.count_post_pvz(point)
|
||||
|
||||
@staticmethod
|
||||
def update_categories(instance):
|
||||
groups = models.Post_and_pvzGroup.objects.filter(category=instance)
|
||||
groups.update(include_in_ml=instance.include_in_ml, visible=instance.visible)
|
||||
for gr in groups:
|
||||
models.RaschetGroups.objects.get_or_create(obj_id=gr.id)
|
||||
objects = models.Post_and_pvz.objects.filter(group=gr)
|
||||
objects.update(include_in_ml=instance.include_in_ml, visible=instance.visible)
|
||||
for obj in objects.all():
|
||||
models.RaschetObjects.objects.get_or_create(obj_id=obj.id)
|
||||
|
||||
@staticmethod
|
||||
def update_groups(instance):
|
||||
models.RaschetGroups.objects.get_or_create(obj_id=instance.id)
|
||||
objects = models.Post_and_pvz.objects.filter(group=instance)
|
||||
objects.update(include_in_ml=instance.include_in_ml, visible=instance.visible)
|
||||
for obj in objects.all():
|
||||
models.RaschetObjects.objects.get_or_create(obj_id=obj.id)
|
||||
|
||||
@staticmethod
|
||||
def get_post_and_pvz_categroies():
|
||||
return models.Post_and_pvzCategory.objects.all(), models.Post_and_pvzGroup.objects.all()
|
||||
|
||||
@staticmethod
|
||||
def count_post_pvz(point):
|
||||
point.rival_post_cnt = models.Post_and_pvz.objects.filter(
|
||||
category__name="Постамат", include_in_ml=True,
|
||||
wkt__distance_lt=(point.geometry, Distance(m=DEFAULT_PLACEMENT_POINT_UPDATE_RADIUS))).count()
|
||||
point.rival_pvz_cnt = models.Post_and_pvz.objects.filter(
|
||||
category__name="ПВЗ", include_in_ml=True,
|
||||
wkt__distance_lt=(point.geometry, Distance(m=DEFAULT_PLACEMENT_POINT_UPDATE_RADIUS))).count()
|
||||
point.save()
|
||||
@ -0,0 +1,63 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from service.utils import run_sql_command, log_to_telegram
|
||||
|
||||
CMD_PIVOT_DIST = """CREATE OR REPLACE VIEW compact_placementpoint AS
|
||||
SELECT id, status, category, age_day, fact, area_id, district_id, prediction_first, prediction_current, doors, flat_cnt, rival_post_cnt, rival_pvz_cnt, target_post_cnt, flats_cnt, tc_cnt, culture_cnt, mfc_cnt, public_stop_cnt, supermarket_cnt, target_dist, metro_dist, geometry FROM service_placementpoint;
|
||||
CREATE OR REPLACE procedure pivot_dist()
|
||||
--RETURNS SET OF record
|
||||
AS $BODY$
|
||||
DECLARE columnNames TEXT;
|
||||
BEGIN
|
||||
DROP MATERIALIZED VIEW IF EXISTS points_with_dist;
|
||||
SELECT 'placement_point_id bigint, ' || string_agg(c, ', ') FROM (SELECT distinct pvz_postamates_group_id, 'd' || pvz_postamates_group_id || ' double precision' as c from service_placementpointpvzdistance order by 1) as asd
|
||||
INTO columnNames;
|
||||
EXECUTE format('CREATE MATERIALIZED VIEW points_with_dist AS SELECT *
|
||||
FROM CROSSTAB(
|
||||
$$
|
||||
SELECT placement_point_id, pvz_postamates_group_id, dist
|
||||
FROM service_placementpointpvzdistance
|
||||
ORDER BY 1, 2
|
||||
$$
|
||||
) AS ct(%s)
|
||||
LEFT JOIN compact_placementpoint ON placement_point_id=id'
|
||||
,columnNames);
|
||||
END;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql;
|
||||
"""
|
||||
|
||||
CMD_PIVOT_DIST_PRE = """CREATE OR REPLACE VIEW compact_preplacementpoint AS
|
||||
SELECT id, status, category, age_day, fact, area_id, district_id, prediction_first, prediction_current, doors, flat_cnt, rival_post_cnt, rival_pvz_cnt, target_post_cnt, flats_cnt, tc_cnt, culture_cnt, mfc_cnt, public_stop_cnt, supermarket_cnt, target_dist, metro_dist, geometry FROM service_preplacementpoint;
|
||||
CREATE OR REPLACE procedure prepivot_dist()
|
||||
AS $BODY$
|
||||
DECLARE columnNames TEXT;
|
||||
BEGIN
|
||||
DROP MATERIALIZED VIEW IF EXISTS prepoints_with_dist;
|
||||
SELECT 'preplacement_point_id bigint, ' || string_agg(c, ', ') FROM (SELECT distinct pvz_postamates_group_id, 'd' || pvz_postamates_group_id || ' double precision' as c from service_preplacementpointpvzdistance order by 1) as asd
|
||||
INTO columnNames;
|
||||
EXECUTE format('CREATE MATERIALIZED VIEW prepoints_with_dist AS SELECT *
|
||||
FROM CROSSTAB(
|
||||
$$
|
||||
SELECT placement_point_id, pvz_postamates_group_id, dist
|
||||
FROM service_preplacementpointpvzdistance
|
||||
ORDER BY 1, 2
|
||||
$$
|
||||
) AS ct(%s)
|
||||
LEFT JOIN compact_preplacementpoint ON preplacement_point_id=id'
|
||||
,columnNames);
|
||||
END;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql;
|
||||
"""
|
||||
class Command(BaseCommand):
|
||||
help = 'Create procedures'
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
try:
|
||||
log_to_telegram('Creating procedures')
|
||||
run_sql_command(CMD_PIVOT_DIST)
|
||||
log_to_telegram('pivot_dist created')
|
||||
run_sql_command(CMD_PIVOT_DIST_PRE)
|
||||
log_to_telegram('prepivot_dist created')
|
||||
except Exception as e:
|
||||
log_to_telegram('Error creating views: ' + str(e))
|
||||
@ -0,0 +1,18 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from service.utils import run_sql_command, log_to_telegram
|
||||
|
||||
CMD_PIVOT_DIST = """CALL public.pivot_dist();"""
|
||||
|
||||
CMD_PIVOT_DIST_PRE = """CALL public.prepivot_dist();"""
|
||||
class Command(BaseCommand):
|
||||
help = 'Create views'
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
try:
|
||||
log_to_telegram('Creating views')
|
||||
run_sql_command(CMD_PIVOT_DIST)
|
||||
log_to_telegram('pivot_dist created')
|
||||
run_sql_command(CMD_PIVOT_DIST_PRE)
|
||||
log_to_telegram('prepivot_dist created')
|
||||
except Exception as e:
|
||||
log_to_telegram('Error creating views: ' + str(e))
|
||||
@ -0,0 +1,18 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from service.utils import run_sql_command, log_to_telegram
|
||||
|
||||
CMD_PIVOT_DIST = """DROP MATERIALIZED VIEW IF EXISTS public.points_with_dist;"""
|
||||
|
||||
CMD_PIVOT_DIST_PRE = """DROP MATERIALIZED VIEW IF EXISTS public.prepoints_with_dist;"""
|
||||
class Command(BaseCommand):
|
||||
help = 'delete views'
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
try:
|
||||
log_to_telegram('Deleting views')
|
||||
run_sql_command(CMD_PIVOT_DIST)
|
||||
log_to_telegram('pivot_dist deleted')
|
||||
run_sql_command(CMD_PIVOT_DIST_PRE)
|
||||
log_to_telegram('prepivot_dist deleted')
|
||||
except Exception as e:
|
||||
log_to_telegram('Error deleting views: ' + str(e))
|
||||
@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.2 on 2023-07-15 13:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0021_auto_20230402_2129'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='LastMLCall',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('dt', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.2 on 2023-08-03 15:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0023_auto_20230801_1654'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TempFiles',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('data', models.TextField()),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,24 @@
|
||||
# Generated by Django 3.2 on 2023-08-04 10:49
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0024_tempfiles'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='otherobjectsgroup',
|
||||
name='category',
|
||||
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='groups', to='service.otherobjectscategory'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='post_and_pvzgroup',
|
||||
name='category',
|
||||
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='groups', to='service.post_and_pvzcategory'),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,31 @@
|
||||
# Generated by Django 3.2 on 2023-08-23 17:16
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0025_auto_20230804_1349'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='post_and_pvz',
|
||||
old_name='inlude_in_ml',
|
||||
new_name='include_in_ml',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='post_and_pvzcategory',
|
||||
old_name='inlude_in_ml',
|
||||
new_name='include_in_ml',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='post_and_pvzgroup',
|
||||
old_name='inlude_in_ml',
|
||||
new_name='include_in_ml',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='PointDist',
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,21 @@
|
||||
# Generated by Django 3.2 on 2023-08-24 17:29
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0026_auto_20230823_2016'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='PostMLChecker',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('current', models.IntegerField(default=0)),
|
||||
('target', models.IntegerField()),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,16 @@
|
||||
# Generated by Django 3.2 on 2023-08-31 12:07
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0027_postmlchecker'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='PostMLChecker',
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2 on 2023-08-31 18:12
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0028_delete_postmlchecker'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='placementpoint',
|
||||
name='postamat_id',
|
||||
field=models.IntegerField(blank=True, null=True, unique=True, verbose_name='ID постамата'),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,35 @@
|
||||
# Generated by Django 3.2 on 2023-09-03 17:06
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0029_alter_placementpoint_postamat_id'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='otherobjects',
|
||||
options={'ordering': ('id',), 'verbose_name': 'Прочий объект', 'verbose_name_plural': 'Прочие объекты'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='placementpoint',
|
||||
options={'ordering': ('id',), 'verbose_name': 'Точка', 'verbose_name_plural': 'Точки'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='post_and_pvz',
|
||||
options={'ordering': ('id',), 'verbose_name': 'Постамат или ПВЗ', 'verbose_name_plural': 'Постаматы и ПВЗ'},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='otherobjects',
|
||||
name='param3',
|
||||
field=models.FloatField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='otherobjects',
|
||||
name='param4',
|
||||
field=models.FloatField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,27 @@
|
||||
# Generated by Django 3.2 on 2023-09-12 13:16
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0031_preplacementpoint'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='preplacementpoint',
|
||||
options={'ordering': ('id',)},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PrePlacementPointPVZDistance',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('dist', models.FloatField(blank=True, default=None, null=True)),
|
||||
('placement_point', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='service.preplacementpoint')),
|
||||
('pvz_postamates_group', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='service.post_and_pvzgroup')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.2 on 2023-09-16 09:23
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0032_auto_20230912_1616'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='RaschetObjects',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('obj_id', models.IntegerField()),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.2 on 2023-09-16 11:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0033_raschetobjects'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='RaschetGroups',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('obj_id', models.IntegerField()),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,333 @@
|
||||
# Generated by Django 3.2 on 2023-09-28 12:19
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0034_raschetgroups'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='attraction_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='bank_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='bc_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='business_activity_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='clinic_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='culture_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='flats_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='kindergar_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='lab_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='metro_dist_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='mfc_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='pharmacy_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='popul_home_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='popul_job_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='property_era_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='property_mean_floor_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='property_price_bargains_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='property_price_offers_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='public_stop_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='reca_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='rival_post_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='rival_pvz_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='school_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='sport_center_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='supermarket_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='supermarket_premium_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='target_cnt_ao_mean_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='target_dist_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='target_post_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='tc_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='yndxfood_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='yndxfood_sum_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='attraction_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='bank_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='bc_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='business_activity_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='clinic_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='culture_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='flats_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='kindergar_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='lab_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='metro_dist_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='mfc_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='pharmacy_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='popul_home_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='popul_job_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='property_era_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='property_mean_floor_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='property_price_bargains_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='property_price_offers_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='public_stop_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='reca_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='rival_post_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='rival_pvz_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='school_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='sport_center_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='supermarket_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='supermarket_premium_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='target_cnt_ao_mean_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='target_dist_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='target_post_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='tc_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='yndxfood_cnt_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='yndxfood_sum_shap',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,32 @@
|
||||
# Generated by Django 3.2 on 2023-10-02 09:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0035_auto_20230928_1519'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='House',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('year_bld', models.IntegerField(blank=True, null=True)),
|
||||
('mat_nes', models.TextField(blank=True, null=True)),
|
||||
('flat_cnt', models.IntegerField(blank=True, null=True)),
|
||||
('levels', models.TextField(blank=True, null=True)),
|
||||
('doors', models.IntegerField(blank=True, null=True)),
|
||||
('enrg_cls', models.TextField(blank=True, null=True)),
|
||||
('street', models.TextField(blank=True, null=True)),
|
||||
('house_number', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Дом',
|
||||
'verbose_name_plural': 'Дома',
|
||||
'ordering': ('id',),
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.2 on 2023-10-02 10:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0036_house'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='placementpoint',
|
||||
name='levels',
|
||||
field=models.TextField(blank=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='preplacementpoint',
|
||||
name='levels',
|
||||
field=models.TextField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,135 @@
|
||||
# Generated by Django 3.2 on 2023-10-08 08:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0037_auto_20231002_1349'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpointpvzdistance',
|
||||
name='placement_point',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpointpvzdistance',
|
||||
name='pvz_postamates_group',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='otherobjectscategory',
|
||||
name='image',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='post_and_pvzcategory',
|
||||
name='image',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d10',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата СДЭК'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d12',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Ozon'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d17',
|
||||
field=models.FloatField(null=True, verbose_name='Расстояние до ПВЗ Wildberries'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d19',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ Yandex'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d20',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Yandex'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d24',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ Почта России'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d25',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Почта России'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d7',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ Ozon'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d8',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ СДЭК'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='placementpoint',
|
||||
name='d9',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Халва'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d10',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата СДЭК'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d12',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Ozon'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d17',
|
||||
field=models.FloatField(null=True, verbose_name='Расстояние до ПВЗ Wildberries'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d19',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ Yandex'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d20',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Yandex'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d24',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ Почта России'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d25',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Почта России'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d7',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ Ozon'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d8',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до ПВЗ СДЭК'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='preplacementpoint',
|
||||
name='d9',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Расстояние до Постамата Халва'),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='PlacementPointPVZDistance',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='PrePlacementPointPVZDistance',
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,122 @@
|
||||
# Generated by Django 3.2 on 2023-10-11 18:20
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('service', '0038_auto_20231008_1141'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d10',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d12',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d17',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d19',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d20',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d24',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d25',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d7',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d8',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='placementpoint',
|
||||
name='d9',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d10',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d12',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d17',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d19',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d20',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d24',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d25',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d7',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d8',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='preplacementpoint',
|
||||
name='d9',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='otherobjectscategory',
|
||||
name='image',
|
||||
field=models.ImageField(blank=True, default=None, null=True, upload_to='other_objects_category_images/', verbose_name='Картинка'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='post_and_pvzcategory',
|
||||
name='image',
|
||||
field=models.ImageField(blank=True, default=None, null=True, upload_to='post_and_pvz_category_images/', verbose_name='Картинка'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PrePlacementPointPVZDistance',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('dist', models.FloatField(blank=True, default=None, null=True)),
|
||||
('placement_point', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='service.preplacementpoint')),
|
||||
('pvz_postamates_group', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='service.post_and_pvzgroup')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PlacementPointPVZDistance',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('dist', models.FloatField(blank=True, default=None, null=True)),
|
||||
('placement_point', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='service.placementpoint')),
|
||||
('pvz_postamates_group', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='service.post_and_pvzgroup')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -1,42 +1,25 @@
|
||||
from django.conf.urls import url
|
||||
from django.urls import include
|
||||
from django.urls import path
|
||||
from django.urls import re_path
|
||||
from drf_yasg import openapi
|
||||
from drf_yasg.views import get_schema_view
|
||||
from rest_framework import permissions
|
||||
from rest_framework import routers
|
||||
|
||||
from postamates.settings import CACHE_TIMEOUT
|
||||
from service import views
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
router.register('', views.PlacementPointViewSet)
|
||||
info = openapi.Info(
|
||||
title='Snippets API',
|
||||
default_version='v1',
|
||||
description='Test description',
|
||||
terms_of_service='https://www.google.com/policies/terms/',
|
||||
contact=openapi.Contact(email='contact@snippets.local'),
|
||||
license=openapi.License(name='BSD License'),
|
||||
)
|
||||
schema_view = get_schema_view(
|
||||
info,
|
||||
url='https://postamates.spatiality.website/',
|
||||
public=True,
|
||||
permission_classes=[permissions.AllowAny],
|
||||
)
|
||||
router.register('placement_points', views.PlacementPointViewSet)
|
||||
router.register('pre_placement_points', views.PrePlacementPointViewSet)
|
||||
router.register('ao_rayons', views.AOViewSet)
|
||||
router.register('postamate_and_pvz_groups', views.PostAndPVZCategoryViewSet)
|
||||
router.register('other_object_groups', views.OtherObjectsCategoryViewSet)
|
||||
|
||||
urlpatterns = router.urls
|
||||
|
||||
urlpatterns = [
|
||||
path('placement_points/', include([*router.urls]), name='placement_points'),
|
||||
path('ao_rayons', views.AOViewSet.as_view({'get': 'list'}), name='ao_and_rayons'),
|
||||
urlpatterns += [
|
||||
url(r'load_csv/', views.refresh_placement_points.as_view(), name='upload_placement_points'),
|
||||
url(r'upload_ao_and_rayons/', views.load_ao_and_rayons.as_view(), name='upload_ao_and_rayons'),
|
||||
url(r'upload_rivals/', views.upload_rivals, name='upload_rivals'),
|
||||
url(r'upload_dist/', views.upload_dist, name='upload_dist'),
|
||||
url(r'upload_post_and_pvz/', views.upload_post_and_pvz, name='upload_post_and_pvz'),
|
||||
url(r'upload_other_objects/', views.upload_other_objects, name='upload_other_objects'),
|
||||
url(r'upload_houses/', views.upload_houses, name='upload_houses'),
|
||||
url(r'me/', views.get_current_user, name='me'),
|
||||
re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
|
||||
re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=CACHE_TIMEOUT), name='schema-swagger-ui'),
|
||||
url('download_pvz_template/', views.download_pvz_template, name='download_pvz_template'),
|
||||
url('download_other_template/', views.download_other_template, name='download_other_template'),
|
||||
url('avg_bi_values/', views.AvgBiValuesViewSet.as_view(), name='avg_bi_values'),
|
||||
]
|
||||
USE_X_FORWARDED_HOST = True
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||