add command to dump existing listing from fs to db

This commit is contained in:
Viktor Barzin 2025-06-04 21:56:26 +00:00
parent f7fb891648
commit 8b2025e700
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
6 changed files with 121 additions and 13 deletions

View file

@ -4,6 +4,7 @@ from dataclasses import dataclass
import json
import pathlib
from typing import Any, List, Dict
from models.listing import ListingSite
from rec import floorplan, routing
import re
import datetime
@ -379,6 +380,18 @@ class Listing:
with open(self.path_price_history(), "r") as f:
return json.load(f)
@property
def longtitude(self) -> float:
return self.detailobject["property"]["longitude"]
@property
def latitude(self) -> float:
return self.detailobject["property"]["latitude"]
@property
def listing_site(self) -> ListingSite:
return ListingSite.RIGHTMOVE # this class supports only right move
async def dict_nicely(self):
travel_time_fastest = {}
travel_time_second = {}