24 lines
1.1 KiB
Python
24 lines
1.1 KiB
Python
from wtforms import SubmitField, StringField, HiddenField, validators, Form
|
|
from flask_wtf import FlaskForm
|
|
from flask import request, render_template, redirect
|
|
from main import db, app, ma
|
|
from sqlalchemy import Sequence
|
|
from sqlalchemy.exc import SQLAlchemyError
|
|
from status import st, Status
|
|
|
|
################################################################################
|
|
# Class describing Author in the database, and via sqlalchemy, connected to the DB as well
|
|
################################################################################
|
|
class Settings(db.Model):
|
|
id = db.Column(db.Integer, db.Sequence('settings_id_seq'), primary_key=True )
|
|
name = db.Column(db.String, unique=True, nullable=True )
|
|
value = db.Column(db.String, unique=True, nullable=True )
|
|
|
|
def __repr__(self):
|
|
return "<id: {}, name: {}, value: {}>".format(self.id, self.name, self.value)
|
|
|
|
### modify the below to add a import path, assumption will be there is only 1 ever import_path, it will have : separated values
|
|
#s = Settings( name="import_path", value="/home/ddp/src/photoassistant/images_to_process" )
|
|
#db.session.add(s)
|
|
#db.session.commit()
|