Exemple #1
0
def home():
    is_up = True
    # noinspection PyBroadException
    try:
        db = get_database()
        init_database(db)
        with db_session:
            if not db.get_connection():
                is_up = False
    except Exception:
        is_up = False

    return 'Up.' if is_up else 'Down.'
Exemple #2
0
from datetime import datetime

from pony.orm import Required, Optional

from common.utils.db_tools import get_database, init_database

db = get_database()


class Feedback(db.Entity):
    user_id = Required(int)
    created = Required(datetime)
    text = Required(str)
    done = Optional(datetime)


init_database(db)