from datetime import datetime import sqlalchemy from flask_sqlalchemy import SQLAlchemy ########################################### # Model classes for describing SQL tables # ########################################### # The "db" object gets bound to the Flask app in app.py. db = SQLAlchemy() # Entries for uploads to corpora, that have no authentication. E.g. "prevodi" or "gigafida". class UploadUnauthenticated(db.Model): __tablename__ = 'upload_unauthenticated' id = db.Column(db.Integer, primary_key=True) upload_hash = db.Column(db.String) timestamp = db.Column(db.DateTime, default=datetime.utcnow) form_name = db.Column(db.String) form_org = db.Column(db.String) form_address = db.Column(db.String) form_zipcode = db.Column(db.String) form_email = db.Column(db.String) file_contract = db.Column(db.String) upload_file_hashes = db.Column(sqlalchemy.types.ARRAY(db.String))