from sqlalchemy import Column, Integer, ForeignKey, Boolean, String
from sqlalchemy.orm import relationship

from scoring_engine.models.base import Base


class Check(Base):
    __tablename__ = "checks"
    id = Column(Integer, primary_key=True)
    round_id = Column(Integer, ForeignKey('rounds.id'))
    round = relationship("Round", back_populates="checks")
    service_id = Column(Integer, ForeignKey('services.id'))
    service = relationship("Service")
    result = Column(Boolean)
    output = Column(String)
    completed_timestamp = Column(String)

    @property
    def completed_timestamp(self):
      # todo make this dynamic and saved when check finishes
      from datetime import datetime
      return str(datetime.now())

@@ -606,16 +606,18 @@
 :%0A      
+  
 # todo m
@@ -669,16 +669,18 @@
 s%0A      
+  
 from dat
@@ -701,16 +701,18 @@
 atetime%0A
+  
       re

Fix pep8 in check model