diff options
author | David Reyna <David.Reyna@windriver.com> | 2020-03-25 21:24:55 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-29 20:02:36 +0100 |
commit | 4dabdbe11ddc47a885c7f8cc6b3f26439d40d77c (patch) | |
tree | 1cfd3f48830d5688e65c283c181767d74a951358 /bitbake/lib/toaster/toastergui | |
parent | 7e252ef31094f760b5666aec9b2205166a8ccbd2 (diff) | |
download | poky-4dabdbe11ddc47a885c7f8cc6b3f26439d40d77c.tar.gz |
bitbake: toaster: migrate to Django-2.2
Toaster migration to Django-2.2. Django-1.x has been deprecated.
[YOCTO #13207]
(Bitbake rev: 9730f95686b2ac72cf1fa513c555f7c7787e2667)
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')
-rw-r--r-- | bitbake/lib/toaster/toastergui/api.py | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 4 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/typeaheads.py | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 16 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/widgets.py | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py index a4afc9e704..b4cdc335ef 100644 --- a/bitbake/lib/toaster/toastergui/api.py +++ b/bitbake/lib/toaster/toastergui/api.py | |||
@@ -24,7 +24,7 @@ from bldcontrol import bbcontroller | |||
24 | 24 | ||
25 | from django.http import HttpResponse, JsonResponse | 25 | from django.http import HttpResponse, JsonResponse |
26 | from django.views.generic import View | 26 | from django.views.generic import View |
27 | from django.core.urlresolvers import reverse | 27 | from django.urls import reverse |
28 | from django.db.models import Q, F | 28 | from django.db.models import Q, F |
29 | from django.db import Error | 29 | from django.db import Error |
30 | from toastergui.templatetags.projecttags import filtered_filesizeformat | 30 | from toastergui.templatetags.projecttags import filtered_filesizeformat |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py b/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py index 71e0925787..7b6f15b2cc 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py +++ b/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | from django import template | 5 | from django import template |
6 | from django.core.urlresolvers import reverse | 6 | from django.urls import reverse |
7 | 7 | ||
8 | register = template.Library() | 8 | register = template.Library() |
9 | 9 | ||
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index b703da3048..c432f59a78 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -44,7 +44,7 @@ def json(value, default = None): | |||
44 | # it manually here | 44 | # it manually here |
45 | return mark_safe(JsonLib.dumps(value, indent=2, default = default, ensure_ascii=False).replace('</', '<\\/')) | 45 | return mark_safe(JsonLib.dumps(value, indent=2, default = default, ensure_ascii=False).replace('</', '<\\/')) |
46 | 46 | ||
47 | @register.assignment_tag | 47 | @register.simple_tag |
48 | def query(qs, **kwargs): | 48 | def query(qs, **kwargs): |
49 | """ template tag which allows queryset filtering. Usage: | 49 | """ template tag which allows queryset filtering. Usage: |
50 | {% query books author=author as mybooks %} | 50 | {% query books author=author as mybooks %} |
@@ -83,7 +83,7 @@ def divide(value, arg): | |||
83 | def multiply(value, arg): | 83 | def multiply(value, arg): |
84 | return int(value) * int(arg) | 84 | return int(value) * int(arg) |
85 | 85 | ||
86 | @register.assignment_tag | 86 | @register.simple_tag |
87 | def datecompute(delta, start = timezone.now()): | 87 | def datecompute(delta, start = timezone.now()): |
88 | return start + timedelta(delta) | 88 | return start + timedelta(delta) |
89 | 89 | ||
diff --git a/bitbake/lib/toaster/toastergui/typeaheads.py b/bitbake/lib/toaster/toastergui/typeaheads.py index fd750ffb74..a1e6fe90f3 100644 --- a/bitbake/lib/toaster/toastergui/typeaheads.py +++ b/bitbake/lib/toaster/toastergui/typeaheads.py | |||
@@ -10,7 +10,7 @@ import subprocess | |||
10 | 10 | ||
11 | from toastergui.widgets import ToasterTypeAhead | 11 | from toastergui.widgets import ToasterTypeAhead |
12 | from orm.models import Project | 12 | from orm.models import Project |
13 | from django.core.urlresolvers import reverse | 13 | from django.urls import reverse |
14 | from django.core.cache import cache | 14 | from django.core.cache import cache |
15 | 15 | ||
16 | 16 | ||
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index e2ead830b1..ae1973ff24 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -19,7 +19,7 @@ from orm.models import Target_Installed_Package, Target_File | |||
19 | from orm.models import TargetKernelFile, TargetSDKFile, Target_Image_File | 19 | from orm.models import TargetKernelFile, TargetSDKFile, Target_Image_File |
20 | from orm.models import BitbakeVersion, CustomImageRecipe | 20 | from orm.models import BitbakeVersion, CustomImageRecipe |
21 | 21 | ||
22 | from django.core.urlresolvers import reverse, resolve | 22 | from django.urls import reverse, resolve |
23 | from django.core.exceptions import ObjectDoesNotExist | 23 | from django.core.exceptions import ObjectDoesNotExist |
24 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger | 24 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger |
25 | from django.http import HttpResponseNotFound, JsonResponse | 25 | from django.http import HttpResponseNotFound, JsonResponse |
@@ -352,7 +352,7 @@ def _get_parameters_values(request, default_count, default_order): | |||
352 | # set cookies for parameters. this is usefull in case parameters are set | 352 | # set cookies for parameters. this is usefull in case parameters are set |
353 | # manually from the GET values of the link | 353 | # manually from the GET values of the link |
354 | def _set_parameters_values(pagesize, orderby, request): | 354 | def _set_parameters_values(pagesize, orderby, request): |
355 | from django.core.urlresolvers import resolve | 355 | from django.urls import resolve |
356 | current_url = resolve(request.path_info).url_name | 356 | current_url = resolve(request.path_info).url_name |
357 | request.session['%s_count' % current_url] = pagesize | 357 | request.session['%s_count' % current_url] = pagesize |
358 | request.session['%s_orderby' % current_url] =orderby | 358 | request.session['%s_orderby' % current_url] =orderby |
@@ -1364,8 +1364,8 @@ if True: | |||
1364 | 1364 | ||
1365 | template = "newproject.html" | 1365 | template = "newproject.html" |
1366 | context = { | 1366 | context = { |
1367 | 'email': request.user.email if request.user.is_authenticated() else '', | 1367 | 'email': request.user.email if request.user.is_authenticated else '', |
1368 | 'username': request.user.username if request.user.is_authenticated() else '', | 1368 | 'username': request.user.username if request.user.is_authenticated else '', |
1369 | 'releases': Release.objects.order_by("description"), | 1369 | 'releases': Release.objects.order_by("description"), |
1370 | } | 1370 | } |
1371 | 1371 | ||
@@ -1391,7 +1391,7 @@ if True: | |||
1391 | # set alert for missing fields | 1391 | # set alert for missing fields |
1392 | raise BadParameterException("Fields missing: %s" % ", ".join(missing)) | 1392 | raise BadParameterException("Fields missing: %s" % ", ".join(missing)) |
1393 | 1393 | ||
1394 | if not request.user.is_authenticated(): | 1394 | if not request.user.is_authenticated: |
1395 | user = authenticate(username = request.POST.get('username', '_anonuser'), password = 'nopass') | 1395 | user = authenticate(username = request.POST.get('username', '_anonuser'), password = 'nopass') |
1396 | if user is None: | 1396 | if user is None: |
1397 | user = User.objects.create_user(username = request.POST.get('username', '_anonuser'), email = request.POST.get('email', ''), password = "nopass") | 1397 | user = User.objects.create_user(username = request.POST.get('username', '_anonuser'), email = request.POST.get('email', ''), password = "nopass") |
@@ -1438,8 +1438,8 @@ if True: | |||
1438 | project = Project.objects.get(pk=pid) | 1438 | project = Project.objects.get(pk=pid) |
1439 | template = "newproject_specific.html" | 1439 | template = "newproject_specific.html" |
1440 | context = { | 1440 | context = { |
1441 | 'email': request.user.email if request.user.is_authenticated() else '', | 1441 | 'email': request.user.email if request.user.is_authenticated else '', |
1442 | 'username': request.user.username if request.user.is_authenticated() else '', | 1442 | 'username': request.user.username if request.user.is_authenticated else '', |
1443 | 'releases': Release.objects.order_by("description"), | 1443 | 'releases': Release.objects.order_by("description"), |
1444 | 'projectname': project.name, | 1444 | 'projectname': project.name, |
1445 | 'project_pk': project.pk, | 1445 | 'project_pk': project.pk, |
@@ -1469,7 +1469,7 @@ if True: | |||
1469 | # set alert for missing fields | 1469 | # set alert for missing fields |
1470 | raise BadParameterException("Fields missing: %s" % ", ".join(missing)) | 1470 | raise BadParameterException("Fields missing: %s" % ", ".join(missing)) |
1471 | 1471 | ||
1472 | if not request.user.is_authenticated(): | 1472 | if not request.user.is_authenticated: |
1473 | user = authenticate(username = request.POST.get('username', '_anonuser'), password = 'nopass') | 1473 | user = authenticate(username = request.POST.get('username', '_anonuser'), password = 'nopass') |
1474 | if user is None: | 1474 | if user is None: |
1475 | user = User.objects.create_user(username = request.POST.get('username', '_anonuser'), email = request.POST.get('email', ''), password = "nopass") | 1475 | user = User.objects.create_user(username = request.POST.get('username', '_anonuser'), email = request.POST.get('email', ''), password = "nopass") |
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index 645f4587e8..ceff52942e 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py | |||
@@ -22,7 +22,7 @@ from django.utils import timezone | |||
22 | from toastergui.templatetags.projecttags import sectohms, get_tasks | 22 | from toastergui.templatetags.projecttags import sectohms, get_tasks |
23 | from toastergui.templatetags.projecttags import json as template_json | 23 | from toastergui.templatetags.projecttags import json as template_json |
24 | from django.http import JsonResponse | 24 | from django.http import JsonResponse |
25 | from django.core.urlresolvers import reverse | 25 | from django.urls import reverse |
26 | 26 | ||
27 | import types | 27 | import types |
28 | import json | 28 | import json |