def get_facets(self): facets = primo.facet_query(self.query) for name, values in facets.items(): f = self.facets.create(name=name) for k, v in values.items(): f.values.create(key=k, count=v)