'Set :py:attr:`forwarded` and :py:attr:`q`.'

def dispatch(self, request, *args, **kwargs):

    if (request.method.upper() not in self.http_method_allowed):
        return HttpResponseNotAllowed(self.http_method_allowed)
    try:
        self.forwarded = json.loads(getattr(request, request.method).get('forward', '{}'))
    except ValueError:
        return HttpResponseBadRequest('Invalid    JSON    data')
    if (not isinstance(self.forwarded, dict)):
        return HttpResponseBadRequest('Not    a    JSON    object')
    self.q = request.GET.get('q', '')
    return super(ViewMixin, self).dispatch(request, *args, **kwargs)
