You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
499 B
Python

# -*- coding: utf-8 -*-
import logging
from website.db_mysql import get_session, to_json
from sqlalchemy import text
class EnterpriseEntityDB(object):
def __init__(self):
pass
def get_entity_suid(self, entity_id: int) -> str:
with get_session() as session:
res = session.execute(text("select suid from enterprise where id=:id"),
{"id": entity_id})
entity = to_json(res)
return entity["suid"] if entity else ""