Пример #1
0
class Post(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(100), nullable=False)
    date_posted = db.Column(db.DateTime,
                            nullable=False,
                            default=datetime.utcnow)
    content = db.Column(db.Text, nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):
        return f"Post('{self.title}','{self.date_posted}')"
Пример #2
0
class Income(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
    source = db.Column(db.String(100))
    amount = db.Column(db.Numeric(10, 2))
    monthly = db.Column(db.Boolean, default=False)
    company = db.Column(db.String(100))
    hours_worked = db.Column(db.Numeric(10, 2))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):
        return f"Income('€{self.amount} ','{self.company}  ','{self.date}')"
Пример #3
0
class Task(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    date_posted = db.Column(db.DateTime,
                            nullable=False,
                            default=datetime.utcnow)
    due_date = db.Column(db.String(20))
    content = db.Column(db.String(100), nullable=False)
    importance = db.Column(db.String(3), nullable=False)
    category = db.Column(db.String(40), nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):
        return f"Task('{self.content}','{self.date_posted}')"
Пример #4
0
class Transaction(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
    content = db.Column(db.String(100), nullable=False)
    category = db.Column(db.String(40), nullable=False)
    tax_percentage = db.Column(db.Integer, default=21)
    amount = db.Column(db.Numeric(10, 2))
    sub = db.Column(db.Boolean, default=False)
    is_deductable = db.Column(db.Boolean, default=False)
    tax_amount = db.Column(db.Numeric(10, 2))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):
        return f"Transaction('{self.amount}','{self.content}','{self.date}')"
Пример #5
0
class Theorem(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(100), nullable=False)
    course = db.Column(db.String(100), nullable=False)
    chapter = db.Column(db.String(100), nullable=False)
    date_posted = db.Column(db.DateTime,
                            nullable=False,
                            default=datetime.utcnow)
    theorem_latex = db.Column(db.Text, nullable=False)
    proof_latex = db.Column(db.Text)
    hint = db.Column(db.Text)
    difficulty = db.Column(db.String(100), nullable=False)
    progress = db.Column(db.String(100))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):
        return f"Theorem('{self.title}','{self.date_posted}')"