diff options
| author | David Reyna <David.Reyna@windriver.com> | 2017-06-27 13:44:30 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 16:02:15 +0100 |
| commit | 4f2baebf362d71351db044c0646f9bc6e8a39c49 (patch) | |
| tree | bcbb07afbe24816f35d0c9d616ac5ea1fcca7f17 /bitbake/lib/toaster/toastergui/api.py | |
| parent | 43aaa802c35ecc9d972f3b9adcd060033de1d9de (diff) | |
| download | poky-4f2baebf362d71351db044c0646f9bc6e8a39c49.tar.gz | |
bitbake: toaster: Add distro selection support
Add the ability to select a distro in the project page,
based on values from the Layer Index. Add a distro selection
page with the add layer feature, based on the add machine
page.
[YOCTO #10632]
(Bitbake rev: a156a4eff67cdc3943494f5be72b96e3db656250)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/api.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/api.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py index 5b035505c2..88d6aa7f68 100644 --- a/bitbake/lib/toaster/toastergui/api.py +++ b/bitbake/lib/toaster/toastergui/api.py | |||
| @@ -874,6 +874,12 @@ class XhrProject(View): | |||
| 874 | machinevar.value = request.POST['machineName'] | 874 | machinevar.value = request.POST['machineName'] |
| 875 | machinevar.save() | 875 | machinevar.save() |
| 876 | 876 | ||
| 877 | # Distro name change | ||
| 878 | if 'distroName' in request.POST: | ||
| 879 | distrovar = prj.projectvariable_set.get(name="DISTRO") | ||
| 880 | distrovar.value = request.POST['distroName'] | ||
| 881 | distrovar.save() | ||
| 882 | |||
| 877 | return JsonResponse({"error": "ok"}) | 883 | return JsonResponse({"error": "ok"}) |
| 878 | 884 | ||
| 879 | def get(self, request, *args, **kwargs): | 885 | def get(self, request, *args, **kwargs): |
| @@ -960,10 +966,11 @@ class XhrProject(View): | |||
| 960 | except ProjectVariable.DoesNotExist: | 966 | except ProjectVariable.DoesNotExist: |
| 961 | data["machine"] = None | 967 | data["machine"] = None |
| 962 | try: | 968 | try: |
| 963 | data["distro"] = project.projectvariable_set.get( | 969 | data["distro"] = {"name": |
| 964 | name="DISTRO").value | 970 | project.projectvariable_set.get( |
| 971 | name="DISTRO").value} | ||
| 965 | except ProjectVariable.DoesNotExist: | 972 | except ProjectVariable.DoesNotExist: |
| 966 | data["distro"] = "-- not set yet" | 973 | data["distro"] = None |
| 967 | 974 | ||
| 968 | data['error'] = "ok" | 975 | data['error'] = "ok" |
| 969 | 976 | ||
