1 """ Wrappers for the results of a search """
3 from __future__
import unicode_literals
6 class PodcastResult(object):
7 """ Wrapper for a Podcast search result """
10 def from_doc(cls
, doc
):
11 """ Construct a PodcastResult from a search result """
14 for key
, val
in doc
['_source'].items():
15 setattr(obj
, key
, val
)
22 return next(iter(self
.slugs
), None)
26 return next(iter(self
.urls
), None)