Graduation Photo Submission Form
import logging
import os
from flask import Flask, render_template, request, jsonify, send_file
from flask_sqlalchemy import SQLAlchemy
import pandas as pd
from io import BytesIO
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///graduation_photos.db'
db = SQLAlchemy(app)
class GraduationPhoto(db.Model):
id = db.Column(db.Integer, primary_key=True)
student_name = db.Column(db.String(100), nullable=False)
grade = db.Column(db.String(20), nullable=False)
carnet = db.Column(db.String(50))
firma_libro = db.Column(db.String(50))
closop = db.Column(db.String(50))
foto_libre = db.Column(db.String(50))
adicional = db.Column(db.String(50))
session = db.Column(db.String(1), nullable=False)
package = db.Column(db.String(20), nullable=False)
Created: | Last Updated:
Here's a step-by-step guide for using the Graduation Photo Submission Form template:
Introduction
This template provides a web application for students to submit graduation photos and personal information through a structured form. It includes features like data storage, Excel export, and Progressive Web App (PWA) functionality.
Getting Started
- Click "Start with this Template" to begin using the Graduation Photo Submission Form template in the Lazy Builder interface.
Test the Application
-
Press the "Test" button in the Lazy Builder interface to deploy and launch the application.
-
Once deployed, Lazy will provide you with a server link to access the web application.
Using the Application
-
Open the provided server link in your web browser to access the Graduation Photo Submission Form.
-
The form includes fields for:
- Student Name
- Grade
- Photo Codes (Carnet, Firma Del Libro, Closop, Foto Libre, Adicional)
- Session
- Package
- Phone Number
-
Additional Items (Taza, Cooler, Llavero, Franela, Chemise)
-
Fill out the form with the required information and submit it.
-
The data will be stored in the SQLite database.
-
To export the submitted data to an Excel file, click the "Exportar a Excel" button at the bottom of the page.
Integrating the Application
This application is designed to be used as a standalone web form. There are no additional integration steps required for external tools or services.
Additional Features
- The application is set up as a Progressive Web App (PWA), allowing it to be installed on supported devices for offline access.
- The Excel export feature calculates totals for additional items and formats the data in a structured spreadsheet.
By following these steps, you'll have a fully functional Graduation Photo Submission Form that can collect and export student data efficiently.