def get_button(request, guid):
    buttonizer = Buttonizer()
    try:
        button = Button.objects.get(guid=guid)
        _can_access(request, button, guid)
    except Button.DoesNotExist:
        raise Http404
    (name, button_file) = buttonizer.create_for_buttonmodel(button)
    response = HttpResponse(mimetype="appplication/zip")
    response['Content-Disposition'] = "attachment; filename="+name
    response.write(button_file.getvalue())
    button_file.close()
    return response
 def test_create_button_with_model(self):
     buttonizer = Buttonizer()
     name, button = buttonizer.create_for_buttonmodel(self.button)