scribeengine/scribeengine/db.py

44 lines
2.0 KiB
Python

# -*- coding: utf-8 -*-
###############################################################################
# ScribeEngine - Open Source Content Management System #
# --------------------------------------------------------------------------- #
# Copyright (c) 2010-2021 Raoul Snyman #
# --------------------------------------------------------------------------- #
# This file is part of ScribeEngine. #
# #
# ScribeEngine is free software: you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# ScribeEngine is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with ScribeEngine. If not, see <https://www.gnu.org/licenses/>. #
###############################################################################
"""
The :mod:`~scribeengine.db` module sets up SQLAlchemy
"""
from flask_sqlalchemy import SQLAlchemy
# Get the db object
db = SQLAlchemy()
# Extract the objects to make them prettier
Model = db.Model
Table = db.Table
Column = db.Column
ForeignKey = db.ForeignKey
String = db.String
Text = db.Text
Integer = db.Integer
Boolean = db.Boolean
DateTime = db.DateTime
relationship = db.relationship
backref = db.backref
inspect = db.inspect
session = db.session