Middleware: using model in process_request and modifying it in process_response
===

Does Django flattening response after process_response?

I have this model (simplified version):

    class Ticket(models.Model):
        is_active = models.BooleanField(default = False)
        remains = models.IntegerField(default = 2)

        def __unicode__(self):
            return '%s' % (self.is_active)

and middleware (simplified):

    class TicketMiddleware(object):
        def process_request(self, request):
            # ...
            try:
                request.ticket = Ticket.objects.get(id=request.GET['ticket'], is_active=True)
                # first case:
                return HttpResponse(request.ticket)
                # second case:
                #return HttpResponse('%s' % (request.ticket))
            except Ticket.DoesNotExists:
                return HttpResponseForbidden()

        def process_response(self, request, response):
            if request.ticket is not None and request.ticket.remains > 0:
                request.ticket -= 1
                if request.ticket == 0:
                    request.ticket.is_active = False
                request.ticket.save()
            return response

In first case I got forbidden page on fourth request:

    1: True
    2: False
    3: False
    4: Forbidden

In second case I got forbidden page on third request:

    1: True
    2: True
    3: Forbidden

And this second case is the way I want. Why I must stringify my model first for properly flow? What I misunderstood?