Files
fsai-api/app/models/miscellaneous.py
Fergal Moran 6b3adfe74f Initial commit
2019-10-09 19:53:50 +01:00

17 lines
501 B
Python

from .. import db
class EditableHTML(db.Model):
id = db.Column(db.Integer, primary_key=True)
editor_name = db.Column(db.String(100), unique=True)
value = db.Column(db.Text)
@staticmethod
def get_editable_html(editor_name):
editable_html_obj = EditableHTML.query.filter_by(
editor_name=editor_name).first()
if editable_html_obj is None:
editable_html_obj = EditableHTML(editor_name=editor_name, value='')
return editable_html_obj