def get_stl(request): print "get stl" slug = request.GET.get('product', '')#Product.objects.get() print slug product = Product.objects.get(slug=slug) #queryset[0].get_item() item = product.get_item() controller = Controller('near', 'Default', 1) print item.uuid controller.get_stl(item.uuid) url = "https://s3.amazonaws.com/deploy_stl_bucket/%s.stl" % item.uuid #signed_url = s3_signed_url("deploy_stl_bucket","%s.stl" % item.uuid) #print signed_url result = simplejson.dumps({ "url": url }, cls=LazyEncoder) return HttpResponse(result)
def get_stl(modeladmin, request, queryset): #queryset.update(status='p') item = queryset[0].get_item() controller = Controller('near', 'Default', 1) controller.get_stl(item.uuid)