from app import db


class Thing(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    description = db.Column(db.String(200))
    descriptionL = db.Column(db.String(500))
    theID = db.Column(db.String(200))
    value = db.Column(db.Integer(), default=0)
    count = db.Column(db.Integer(), default=0)

    def __repr__(self):
        return "<Thing {}>".format(self.TheID)

    def upvote(self):
        self.value += 1

    def choosen(self):
        self.count += 1
