merging the visual query answering with the crawler. Monorepo go!
This commit is contained in:
parent
85686a8b24
commit
e2f7998ee9
32 changed files with 3449 additions and 0 deletions
38
rec/db.py
38
rec/db.py
|
|
@ -1,38 +0,0 @@
|
|||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy import Column, Integer, JSON, FLOAT
|
||||
from sqlalchemy.orm import declarative_base
|
||||
|
||||
engine = create_engine("sqlite:///sqlite.db", echo=True)
|
||||
session = Session(engine)
|
||||
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
|
||||
class RightmoveListing(Base):
|
||||
__tablename__ = "rightmove"
|
||||
id = Column(Integer, primary_key=True)
|
||||
price = Column(FLOAT)
|
||||
listing_json = Column(JSON, nullable=True)
|
||||
detail_json = Column(JSON, nullable=True)
|
||||
updated_timestamp = Column(Integer, nullable=True)
|
||||
lat = Column(FLOAT)
|
||||
lon = Column(FLOAT)
|
||||
distance_to_office_minutes = Column(FLOAT, nullable=True)
|
||||
|
||||
def save(self):
|
||||
session.add(self)
|
||||
session.commit()
|
||||
|
||||
def __repr__(self):
|
||||
return "<RightMoveListing(id='{}', price='{}', lat={}, lon={}')>".format(
|
||||
self.id,
|
||||
self.price,
|
||||
self.lat,
|
||||
self.lon,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
Base.metadata.create_all(engine)
|
||||
Loading…
Add table
Add a link
Reference in a new issue