You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from application.controlers import Example
app.register_blueprint(Example.bp)
Model
application/models/Example_Model.py
from system import Model
class Example_Model(Model):
def example(self):
sql = '''[QUERY]'''
self.execute(sql)
res = self.fetchall()
self.close()
return res
application/models/_init_.py
from .Example_Model import Example_Model as Example_Model
application/controllers/Example.py
from models import Example_Model
example_model = Example_Model()
query 실행
self.execute(sql: str, *data: str | int)
query 결과
self.fetchall()
self.fetchone()
self.insert_id()
db 연결 해제
self.close()
Util
application/utils/Example_Util.py
class Example_Util():
[UTIL_METHOD]
application/utils/_init_.py
from .Example_Util import Example_Util as Example_Util
from application.utils import Example_Util
util = Example_Util()
util.[UTIL_METHOD]
Input
from system import Input
input = Input()
input.get(name: str | None = None, default: Any | None = None, type: type | None = None, action: 'store' | 'append' = 'store', literal: list | tuple | set | None = None)
input.post(name: str | None = None, default: Any | None = None, type: type | None = None, action: 'store' | 'append' = 'store', literal: list | tuple | set | None = None)