aboutsummaryrefslogtreecommitdiff
path: root/src/web/models/category.py
blob: 7805480910b11294854c607d73dfde3cffec80d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
from bootstrap import db


class Category(db.Model):
    id = db.Column(db.Integer(), primary_key=True)
    name = db.Column(db.String())

    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))

    def dump(self):
        return {key: getattr(self, key) for key in ('id', 'name', 'user_id')}
bgstack15