summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 389457daf3..b58f916d8c 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -27,7 +27,7 @@ import operator,re
27 27
28from django.db.models import F, Q, Sum, Count, Max 28from django.db.models import F, Q, Sum, Count, Max
29from django.db import IntegrityError, Error 29from django.db import IntegrityError, Error
30from django.shortcuts import render, redirect 30from django.shortcuts import render, redirect, get_object_or_404
31from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable 31from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
32from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency 32from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
33from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact 33from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact
@@ -2462,6 +2462,19 @@ if True:
2462 else: 2462 else:
2463 return {"error": "Method %s is not supported" % request.method} 2463 return {"error": "Method %s is not supported" % request.method}
2464 2464
2465 def customrecipe_download(request, pid, recipe_id):
2466 recipe = get_object_or_404(CustomImageRecipe, pk=recipe_id)
2467
2468 file_data = recipe.generate_recipe_file_contents()
2469
2470 response = HttpResponse(file_data, content_type='text/plain')
2471 response['Content-Disposition'] = \
2472 'attachment; filename="%s_%s.bb"' % (recipe.name,
2473 recipe.version)
2474
2475 return response
2476
2477
2465 @xhr_response 2478 @xhr_response
2466 def xhr_customrecipe_packages(request, recipe_id, package_id): 2479 def xhr_customrecipe_packages(request, recipe_id, package_id):
2467 """ 2480 """