|
|
@@ -1,10 +1,13 @@
|
|
|
+import datetime
|
|
|
import db
|
|
|
import geo_util
|
|
|
import config
|
|
|
|
|
|
def load_properties(require_active=True):
|
|
|
+ ts = db.datetime_to_str(datetime.datetime.now() - datetime.timedelta(days=180))
|
|
|
with db.connect() as conn:
|
|
|
- rows = conn.select('select id, lat, lon, size, price, bedrooms, ber from properties where price<%i and property_type != "Site"' % config.MAX_PRICE)
|
|
|
+ rows = conn.select('select id, lat, lon, size, price, bedrooms, ber from properties '
|
|
|
+ 'where price<%i and property_type != "Site" and last_update > "%s"' % (config.MAX_PRICE, ts))
|
|
|
|
|
|
res = {}
|
|
|
for property_id, lat, lon, size, price, bedrooms, ber in rows:
|