routing and model __init__ updates
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
from api.database import (Model, SurrogatePK, db,
|
||||
Column, reference_col, relationship)
|
||||
Column)
|
||||
|
||||
|
||||
class TargetExchange(SurrogatePK, Model):
|
||||
__tablename__ = "target-exchange"
|
||||
name = Column(db.String(255), unique=True, nullable=False)
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(TargetExchange, self).__init__(**kwargs)
|
||||
|
||||
@staticmethod
|
||||
def ensure_created(name):
|
||||
if TargetExchange.query.filter_by(name=name).first() is None:
|
||||
|
||||
Reference in New Issue
Block a user