Compare commits

3 Commits

Author SHA1 Message Date
5577576112 Update README.md
update readme file
2026-04-07 11:42:23 +00:00
ce0e4f90cf Merge pull request 'updateds folder path and regex' (#14) from pankaj-dev into main
Reviewed-on: #14
2026-03-18 04:51:41 +00:00
1d83534a95 updateds folder path and regex 2026-03-18 10:19:11 +05:30
5 changed files with 17 additions and 11 deletions

View File

@@ -36,7 +36,8 @@ The Comparison Project is designed to:
## Tech Stack ## Tech Stack
**Backend Framework**: Flask **Frontend Framework**: HTML, CSS, Js, Bootstrap
**Backend Framework**: Python Flask
**Database**: SQL Database (MySQL/PostgreSQL/SQLite configured via environment variables) **Database**: SQL Database (MySQL/PostgreSQL/SQLite configured via environment variables)
**ORM**: SQLAlchemy **ORM**: SQLAlchemy
**File Processing**: Pandas, OpenPyXL, XlsxWriter **File Processing**: Pandas, OpenPyXL, XlsxWriter
@@ -580,4 +581,4 @@ Open browser: `http://127.0.0.1:5000/`
For issues, feature requests, or contributions, please contact the development team. For issues, feature requests, or contributions, please contact the development team.
**Last Updated:** January 2026 **Last Updated:** April 2026

View File

@@ -1,5 +1,6 @@
from flask import Blueprint, render_template, send_from_directory, abort, current_app from flask import Blueprint, render_template, send_from_directory, abort, current_app
from app.utils.helpers import login_required from app.utils.helpers import login_required
from app.utils.file_utils import get_download_format_folder
import os import os
file_format_bp = Blueprint("file_format", __name__) file_format_bp = Blueprint("file_format", __name__)
@@ -14,10 +15,7 @@ def download_format():
@login_required @login_required
def download_excel_format(filename): def download_excel_format(filename):
download_folder = os.path.join( download_folder = get_download_format_folder()
current_app.root_path, "static", "downloads/format"
)
file_path = os.path.join(download_folder, filename) file_path = os.path.join(download_folder, filename)
if not os.path.exists(file_path): if not os.path.exists(file_path):

View File

@@ -224,15 +224,12 @@ def comparison_report():
subcontractor_id=subcontractor_id subcontractor_id=subcontractor_id
).all()] ).all()]
df_dc = build_comparison(dc_client, dc_sub, "MH_NO") df_dc = build_comparison(dc_client, dc_sub, "MH_NO")
# df_dc = build_comparison_mh_dc(dc_client, dc_sub, "MH_NO")
lay_client = [r.serialize() for r in LayingClient.query.all()] lay_client = [r.serialize() for r in LayingClient.query.all()]
lay_sub = [r.serialize() for r in Laying.query.filter_by( lay_sub = [r.serialize() for r in Laying.query.filter_by(
subcontractor_id=subcontractor_id subcontractor_id=subcontractor_id
).all()] ).all()]
df_lay = build_comparison(lay_client, lay_sub, "MH_NO") df_lay = build_comparison(lay_client, lay_sub, "MH_NO")
# df_lay = build_comparison_laying(lay_client, lay_sub, "MH_NO")
# -------- EXCEL -------- # -------- EXCEL --------
output = io.BytesIO() output = io.BytesIO()

View File

@@ -1,6 +1,16 @@
import os import os
from flask import current_app
from app.config import Config from app.config import Config
def get_download_format_folder():
return os.path.join(
current_app.root_path,
"static",
"downloads",
"format"
)
def ensure_upload_folder(): def ensure_upload_folder():
if not os.path.exists(Config.UPLOAD_FOLDER): if not os.path.exists(Config.UPLOAD_FOLDER):
os.makedirs(Config.UPLOAD_FOLDER) os.makedirs(Config.UPLOAD_FOLDER)