Skip to content

Commit

Permalink
Add entity.id as a search param for events
Browse files Browse the repository at this point in the history
  • Loading branch information
mbonnefoy committed Jul 4, 2019
1 parent 51fc43b commit 38157b9
Show file tree
Hide file tree
Showing 2 changed files with 10 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
3 changes: 2 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,7 @@ class Options:
signal = ModelType(Signal)
relevance = ListType(StringType)
brand_unsafe = ModelType(BrandUnsafe)
entity = ModelType(Entity)


class Entities(Model):
Expand Down

0 comments on commit 38157b9

Please sign in to comment.