Fix module import
This commit is contained in:
@@ -2,7 +2,7 @@ from psycopg.rows import Row
|
||||
from .s0_base import *
|
||||
from .change_set import ChangeSet
|
||||
from .s24_coordinates import *
|
||||
import utility
|
||||
from .utility import *
|
||||
|
||||
|
||||
def add_junction(name: str, id: str, x: float, y: float, elevation: float) -> ChangeSet:
|
||||
@@ -12,7 +12,7 @@ def add_junction(name: str, id: str, x: float, y: float, elevation: float) -> Ch
|
||||
|
||||
|
||||
def _get_junction(name: str, id: str) -> Row | None:
|
||||
return utility.query(name, f"select elevation, demand, pattern from junctions where id = '{id}'")
|
||||
return query(name, f"select elevation, demand, pattern from junctions where id = '{id}'")
|
||||
|
||||
|
||||
def delete_junction(name: str, id: str) -> ChangeSet:
|
||||
@@ -24,8 +24,8 @@ def delete_junction(name: str, id: str) -> ChangeSet:
|
||||
return ChangeSet()
|
||||
|
||||
elevation = row['elevation']
|
||||
demand = utility.decorate(row['demand'], 'float', True)
|
||||
pattern = utility.decorate(row['pattern'], 'str', True)
|
||||
demand = decorate(row['demand'], 'float', True)
|
||||
pattern = decorate(row['pattern'], 'str', True)
|
||||
|
||||
sql = f"delete from junctions where id = '{id}';"
|
||||
undo_sql = f'insert into junctions (id, elevation, demand, pattern) values ("{id}", {elevation}, {demand}, {pattern});'
|
||||
@@ -66,7 +66,7 @@ def _set_junction(name: str, id: str, key: str, key_type: str, value: str, optio
|
||||
if row == None:
|
||||
return ChangeSet()
|
||||
|
||||
return utility.update(name, JUNCTION, 'junctions', 'id', id, key, key_type, row[key], value, optional)
|
||||
return update(name, JUNCTION, 'junctions', 'id', id, key, key_type, row[key], value, optional)
|
||||
|
||||
|
||||
def set_junction_elevation(name: str, id: str, elevation: float) -> ChangeSet:
|
||||
|
||||
Reference in New Issue
Block a user