mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Refactor utils.py as a helper class so we have some control about when the lookup services actually start
This commit is contained in:
@@ -9,7 +9,6 @@ from bottle import run, request, response, template
|
||||
|
||||
from core.config import MAX_SPOT_AGE, ALLOW_SPOTTING
|
||||
from core.constants import BANDS, ALL_MODES, MODE_TYPES, SIGS, CONTINENTS
|
||||
from core.utils import serialize_everything
|
||||
from data.spot import Spot
|
||||
|
||||
|
||||
@@ -252,3 +251,10 @@ class WebServer:
|
||||
options["spot_sources"].append("API")
|
||||
|
||||
return options
|
||||
|
||||
|
||||
# Convert objects to serialisable things. Used by JSON serialiser as a default when it encounters unserializable things.
|
||||
# Just converts objects to dict. Try to avoid doing anything clever here when serialising spots, because we also need
|
||||
# to receive spots without complex handling.
|
||||
def serialize_everything(obj):
|
||||
return obj.__dict__
|
||||
Reference in New Issue
Block a user