@post_dump(pass_many=True)<EOL><INDENT>def envelope(self, data, many):<DEDENT>
if not many:<EOL><INDENT>return data<EOL><DEDENT>result = dict(<EOL>hits=dict(<EOL>hits=data,<EOL>total=self.context.get('<STR_LIT>', len(data))<EOL>)<EOL>)<EOL>page = self.context.get('<STR_LIT>')<EOL>if page:<EOL><INDENT>links_pagination_factory = self.context.get(<EOL>'<STR_LIT>',<EOL>default_links_pagination_factory<EOL>)<EOL>urlkwargs = self.context.get('<STR_LIT>', {})<EOL>result['<STR_LIT>'] = links_pagination_factory(page, urlkwargs)<EOL><DEDENT>return result<EOL>
Wrap result in envelope.