"""
models.py

Set up all our ORM Models
"""
import os

import flask_sqlalchemy

from . import app

app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DATABASE_URL']
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = flask_sqlalchemy.SQLAlchemy(app)


class ThingModel(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    content = db.Column(db.String(140))

    def as_dict(self):
        return {'id': self.id, 'content': self.content}
