diff --git a/predicthq/endpoints/schemas.py b/predicthq/endpoints/schemas.py index 33bee87..48ab0e2 100644 --- a/predicthq/endpoints/schemas.py +++ b/predicthq/endpoints/schemas.py @@ -125,8 +125,8 @@ class Place(Model): class Options: serialize_when_none = False - scope = ListType(IntType) - exact = ListType(IntType) + scope = ListType(StringType) + exact = ListType(StringType) class DateTimeRange(Model): diff --git a/predicthq/endpoints/v1/events/schemas.py b/predicthq/endpoints/v1/events/schemas.py index 0956624..1b715a6 100644 --- a/predicthq/endpoints/v1/events/schemas.py +++ b/predicthq/endpoints/v1/events/schemas.py @@ -69,7 +69,7 @@ class TopEventsSearchParams(SortableMixin, Model): class CalendarParams(SearchParams): top_events = ModelType(TopEventsSearchParams) - view = StringType(choices=('active',)) + view = StringType(choices=('active', 'start')) class CalendarDay(Model): diff --git a/predicthq/endpoints/v1/signals/schemas.py b/predicthq/endpoints/v1/signals/schemas.py index 77c1f1f..6c3081e 100644 --- a/predicthq/endpoints/v1/signals/schemas.py +++ b/predicthq/endpoints/v1/signals/schemas.py @@ -4,7 +4,7 @@ from schematics.transforms import blacklist, wholelist, whitelist from predicthq.endpoints.schemas import Model, StringType, ListType, ModelType, DateTimeType, ResultSet, ResultType, SortableMixin, FloatType, IntType, DictType, \ - PaginatedMixin, DateTimeRange, StringListType, StringModelType, Area, BooleanType, DateType + PaginatedMixin, DateTimeRange, StringListType, StringModelType, Area, BooleanType, DateType, Place class SignalsSearchParams(SortableMixin, Model): @@ -94,7 +94,7 @@ class SignalResultSet(ResultSet): class DataPoint(Model): uid = StringType(required=True) - date = DateTimeType(requird=True) + date = DateTimeType(required=True) latitude = FloatType(min_value=-90, max_value=90, required=True) longitude = FloatType(min_value=-180, max_value=180, required=True) initiated = DateTimeType() @@ -202,4 +202,6 @@ class Options: significance = IntType(min_value=0, max_value=100) lead = BooleanType(default=False) span = BooleanType(default=False) + place = ModelType(Place) + # @todo: Support custom dimensions from signal diff --git a/setup.py b/setup.py index c231c9a..629cecd 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ def read(*parts): install_requires=[ "six>=1.9.0", "requests>=2.7.0", - "schematics>=2.0.0.dev2", + "schematics==2.0.0.dev2", "python-dateutil>=2.4.2", "pytz>=2015.4", ],