This repository has been archived on 2025-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
RIS/App/Report/report_model.py

21 lines
831 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from dataclasses import dataclass
from Database.select import select_list
from Database.sql_provider import SQLProvider
from flask import current_app
from os import path
sql_provider = SQLProvider(path.join(path.dirname(__file__), 'sql'))
@dataclass
class InfoRespronse:
result: tuple
error_message: str
status: bool
def quanterly(input_data) -> InfoRespronse:
_sql = sql_provider.get('sklad_material.sql', input_data)
result = select_list(current_app.config['db_config'], _sql)
if result is None:
return InfoRespronse((),
error_message = 'Ошибка в подключении к базе данных. Свяжитесь с администратором',
status=False)
return InfoRespronse(result, error_message='', status=True)