Fix module import

This commit is contained in:
wqy
2022-09-17 18:42:12 +08:00
parent 47e0b48025
commit 8cf5895f1d
6 changed files with 23 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
from psycopg.rows import Row
from .s0_base import *
from .change_set import ChangeSet
import utility
from .utility import *
PIPE_STATUS_OPEN = 'open'
@@ -21,7 +21,7 @@ def add_pipe(name: str, id: str, node1: str, node2: str, length: float = 0, diam
def _get_pipe(name: str, id: str) -> Row | None:
return utility.query(name, f"select node1, node2, length, diameter, roughness, minor_loss, status from pipes where id = '{id}'")
return query(name, f"select node1, node2, length, diameter, roughness, minor_loss, status from pipes where id = '{id}'")
def delete_pipe(name: str, id: str) -> ChangeSet:
@@ -83,7 +83,7 @@ def _set_pipe(name: str, id: str, key: str, key_type: str, value: str, optional:
if row == None:
return ChangeSet()
return utility.update(name, PIPE, 'pipes', 'id', id, key, key_type, row[key], value, optional)
return update(name, PIPE, 'pipes', 'id', id, key, key_type, row[key], value, optional)
def set_pipe_node1(name: str, id: str, node1: str) -> ChangeSet: