dev
AlexP077 3 years ago committed by Dmitry Titov
parent fa52db03cc
commit 0186f5f836

@ -0,0 +1,17 @@
# Generated by Django 3.2 on 2023-03-22 16:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('service', '0016_alter_placementpoint_status'),
]
operations = [
migrations.RenameField(
model_name='rivals',
old_name='WKT',
new_name='wkt',
),
]

@ -54,7 +54,7 @@ class Rayon(models.Model):
class Rivals(models.Model):
WKT = gis_models.PointField(srid=SRID, null=True)
wkt = gis_models.PointField(srid=SRID, null=True)
info = models.TextField(null=True, blank=True)
type = models.TextField(null=True, blank=True)
source = models.TextField(null=True, blank=True)

@ -53,6 +53,7 @@ def load_rivals(filepath: str):
df = pd.read_csv(filepath)
df = df.replace(np.nan, None)
df = df.replace('NaT', None)
df.columns = df.columns.str.lower()
for row in tqdm(df.to_dict('records'), desc='Loading data...'):
models.Rivals.objects.create(**row)

Loading…
Cancel
Save