mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
29 lines
725 B
Python
29 lines
725 B
Python
from sqlalchemy import (
|
|
Column,
|
|
Integer,
|
|
String,
|
|
JSON,
|
|
TIMESTAMP,
|
|
UniqueConstraint,
|
|
)
|
|
from sqlalchemy.orm import declarative_base
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
class EpcStore(Base):
|
|
"""
|
|
Stores EPC data retrieved from the EPC API and EPC web pages.
|
|
"""
|
|
__tablename__ = "epc_store"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
uprn = Column(Integer)
|
|
epc_api_created_at = Column(TIMESTAMP(timezone=False))
|
|
epc_api = Column(JSON, nullable=False)
|
|
epc_page_created_at = Column(TIMESTAMP(timezone=False))
|
|
epc_page = Column(String)
|
|
epc_page_rrn = Column(String)
|
|
|
|
def __repr__(self):
|
|
return f"<EpcStore(id={self.id}, uprn='{self.uprn}')>"
|