CICD/app/fizz/fizzbar/model.py

20 lines
504 B
Python
Raw Normal View History

2019-05-18 19:00:13 +02:00
from sqlalchemy import Integer, Column, String
from app import db # noqa
from .interface import FizzbarInterface
from typing import Any
class Fizzbar(db.Model): # type: ignore
2019-08-03 18:55:38 +02:00
"""A snazzy Fizzbar"""
2019-05-18 19:00:13 +02:00
2019-08-03 18:55:38 +02:00
__tablename__ = "fizzbar"
2019-05-18 19:00:13 +02:00
fizzbar_id = Column(Integer(), primary_key=True)
name = Column(String(255))
purpose = Column(String(255))
def update(self, changes: FizzbarInterface):
for key, val in changes.items():
setattr(self, key, val)
return self