Skip to content

Commit

Permalink
Merge 38157b9 into db2f113
Browse files Browse the repository at this point in the history
  • Loading branch information
mbonnefoy committed Jul 4, 2019
2 parents db2f113 + 38157b9 commit a9f46e0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
8 changes: 8 additions & 0 deletions predicthq/endpoints/schemas.py
Expand Up @@ -211,6 +211,14 @@ class Options:
exclude = BooleanType()


class Entity(Model):

class Options:
serialize_when_none = False

id = StringType()


class LimitMixin(Model):

limit = IntType(min_value=1)
Expand Down
15 changes: 14 additions & 1 deletion predicthq/endpoints/v1/events/schemas.py
Expand Up @@ -5,7 +5,7 @@
PaginatedMixin, SortableMixin, Model, ResultSet, ListType, StringType, GeoJSONPointType,
StringListType, StringModelType, Area, ModelType, IntRange, IntType, DateTimeRange,
DateTimeType, FloatType, ResultType, DictType, DateType, Place, Signal, DateAround,
LocationAround, BooleanType, BrandUnsafe
LocationAround, BooleanType, BrandUnsafe, Entity
)


Expand Down Expand Up @@ -36,6 +36,18 @@ class Options:
signal = ModelType(Signal)
relevance = ListType(StringType)
brand_unsafe = ModelType(BrandUnsafe)
entity = ModelType(Entity)


class Entities(Model):

class Options:
serialize_when_none = True

entity_id = StringType()
name = StringType()
type = StringType()
formatted_address = StringType()


class Event(Model):
Expand All @@ -55,6 +67,7 @@ class Options:
country = StringType()
rank = IntType()
local_rank = IntType()
entities = ListType(ModelType(Entities))
location = GeoJSONPointType()
place_hierarchies = ListType(ListType(StringType()))
scope = StringType()
Expand Down

0 comments on commit a9f46e0

Please sign in to comment.