Skip to content

Commit

Permalink
Merge pull request #9 from predicthq/iata-places
Browse files Browse the repository at this point in the history
Support IATA for places
  • Loading branch information
Thierry Jossermoz committed May 10, 2016
2 parents 157442c + 8bd3191 commit 4dfd83d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions predicthq/endpoints/schemas.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion predicthq/endpoints/v1/events/schemas.py
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions predicthq/endpoints/v1/signals/schemas.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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",
],
Expand Down

0 comments on commit 4dfd83d

Please sign in to comment.