14 lines
359 B
Python
14 lines
359 B
Python
from geruecht import db
|
|
|
|
|
|
class User(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
username = db.Column(db.String(20), unique=True, nullable=False)
|
|
sum = db.Column(db.Float, nullable=False, default=0.0)
|
|
|
|
def add(self, value):
|
|
self.sum += value
|
|
|
|
def __repr__(self):
|
|
return f"User('{self.username}', '{self.sum}')"
|