some more importpoc stuff
This commit is contained in:
parent
5efca75f6f
commit
ec057be7c1
1 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ class PocImportItem(BaseModel):
|
||||||
"""
|
"""
|
||||||
Something imported from the NOC
|
Something imported from the NOC
|
||||||
"""
|
"""
|
||||||
type: Literal["Point"] = "Point"
|
type: Literal["Feature"] = "Feature"
|
||||||
geometry: PointSchema
|
geometry: PointSchema
|
||||||
properties: PocImportItemProperties
|
properties: PocImportItemProperties
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class Command(BaseCommand):
|
||||||
help = 'import APs from noc'
|
help = 'import APs from noc'
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
r = requests.get(settings.POC_BASE+"/antenna-locations", headers={'ApiKey': settings.POC_API_SECRET})
|
r = requests.get(settings.POC_API_BASE+"/antenna-locations", headers={'ApiKey': settings.POC_API_SECRET})
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
items = TypeAdapter(list[PocImportItem]).validate_python(r.json())
|
items = TypeAdapter(list[PocImportItem]).validate_python(r.json())
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class Command(BaseCommand):
|
||||||
import_tag = f"poc:{item.properties.name}"
|
import_tag = f"poc:{item.properties.name}"
|
||||||
|
|
||||||
# determine geometry
|
# determine geometry
|
||||||
level_id = levels_by_level_index[item.properties.level]
|
level_id = levels_by_level_index[item.properties.level].pk
|
||||||
|
|
||||||
point: Point = shape(item.geometry.model_dump()) # nowa
|
point: Point = shape(item.geometry.model_dump()) # nowa
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue