diff options
40 files changed, 197 insertions, 174 deletions
diff --git a/bitbake/lib/toaster/bldcollector/views.py b/bitbake/lib/toaster/bldcollector/views.py index 6d9227cd7f..04cd8b3dd4 100644 --- a/bitbake/lib/toaster/bldcollector/views.py +++ b/bitbake/lib/toaster/bldcollector/views.py | |||
@@ -6,7 +6,7 @@ | |||
6 | # SPDX-License-Identifier: GPL-2.0-only | 6 | # SPDX-License-Identifier: GPL-2.0-only |
7 | # | 7 | # |
8 | 8 | ||
9 | from django.core.urlresolvers import reverse | 9 | from django.urls import reverse |
10 | from django.http import HttpResponseBadRequest, HttpResponse | 10 | from django.http import HttpResponseBadRequest, HttpResponse |
11 | import os | 11 | import os |
12 | import tempfile | 12 | import tempfile |
diff --git a/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py b/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py index 67db378561..7ee19f4745 100644 --- a/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py +++ b/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py | |||
@@ -37,7 +37,7 @@ class Migration(migrations.Migration): | |||
37 | ('giturl', models.CharField(max_length=254)), | 37 | ('giturl', models.CharField(max_length=254)), |
38 | ('commit', models.CharField(max_length=254)), | 38 | ('commit', models.CharField(max_length=254)), |
39 | ('dirpath', models.CharField(max_length=254)), | 39 | ('dirpath', models.CharField(max_length=254)), |
40 | ('layer_version', models.ForeignKey(to='orm.Layer_Version', null=True)), | 40 | ('layer_version', models.ForeignKey(to='orm.Layer_Version', null=True, on_delete=models.CASCADE)), |
41 | ], | 41 | ], |
42 | ), | 42 | ), |
43 | migrations.CreateModel( | 43 | migrations.CreateModel( |
@@ -80,34 +80,34 @@ class Migration(migrations.Migration): | |||
80 | ('state', models.IntegerField(default=0, choices=[(0, b'created'), (1, b'queued'), (2, b'in progress'), (3, b'completed'), (4, b'failed'), (5, b'deleted'), (6, b'archive')])), | 80 | ('state', models.IntegerField(default=0, choices=[(0, b'created'), (1, b'queued'), (2, b'in progress'), (3, b'completed'), (4, b'failed'), (5, b'deleted'), (6, b'archive')])), |
81 | ('created', models.DateTimeField(auto_now_add=True)), | 81 | ('created', models.DateTimeField(auto_now_add=True)), |
82 | ('updated', models.DateTimeField(auto_now=True)), | 82 | ('updated', models.DateTimeField(auto_now=True)), |
83 | ('build', models.OneToOneField(null=True, to='orm.Build')), | 83 | ('build', models.OneToOneField(null=True, to='orm.Build', on_delete=models.CASCADE)), |
84 | ('environment', models.ForeignKey(to='bldcontrol.BuildEnvironment', null=True)), | 84 | ('environment', models.ForeignKey(to='bldcontrol.BuildEnvironment', null=True, on_delete=models.CASCADE)), |
85 | ('project', models.ForeignKey(to='orm.Project')), | 85 | ('project', models.ForeignKey(to='orm.Project', on_delete=models.CASCADE)), |
86 | ], | 86 | ], |
87 | ), | 87 | ), |
88 | migrations.AddField( | 88 | migrations.AddField( |
89 | model_name='brvariable', | 89 | model_name='brvariable', |
90 | name='req', | 90 | name='req', |
91 | field=models.ForeignKey(to='bldcontrol.BuildRequest'), | 91 | field=models.ForeignKey(to='bldcontrol.BuildRequest', on_delete=models.CASCADE), |
92 | ), | 92 | ), |
93 | migrations.AddField( | 93 | migrations.AddField( |
94 | model_name='brtarget', | 94 | model_name='brtarget', |
95 | name='req', | 95 | name='req', |
96 | field=models.ForeignKey(to='bldcontrol.BuildRequest'), | 96 | field=models.ForeignKey(to='bldcontrol.BuildRequest', on_delete=models.CASCADE), |
97 | ), | 97 | ), |
98 | migrations.AddField( | 98 | migrations.AddField( |
99 | model_name='brlayer', | 99 | model_name='brlayer', |
100 | name='req', | 100 | name='req', |
101 | field=models.ForeignKey(to='bldcontrol.BuildRequest'), | 101 | field=models.ForeignKey(to='bldcontrol.BuildRequest', on_delete=models.CASCADE), |
102 | ), | 102 | ), |
103 | migrations.AddField( | 103 | migrations.AddField( |
104 | model_name='brerror', | 104 | model_name='brerror', |
105 | name='req', | 105 | name='req', |
106 | field=models.ForeignKey(to='bldcontrol.BuildRequest'), | 106 | field=models.ForeignKey(to='bldcontrol.BuildRequest', on_delete=models.CASCADE), |
107 | ), | 107 | ), |
108 | migrations.AddField( | 108 | migrations.AddField( |
109 | model_name='brbitbake', | 109 | model_name='brbitbake', |
110 | name='req', | 110 | name='req', |
111 | field=models.OneToOneField(to='bldcontrol.BuildRequest'), | 111 | field=models.OneToOneField(to='bldcontrol.BuildRequest', on_delete=models.CASCADE), |
112 | ), | 112 | ), |
113 | ] | 113 | ] |
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py index 0d30fd9be0..c2f302da24 100644 --- a/bitbake/lib/toaster/bldcontrol/models.py +++ b/bitbake/lib/toaster/bldcontrol/models.py | |||
@@ -85,9 +85,9 @@ class BuildRequest(models.Model): | |||
85 | 85 | ||
86 | search_allowed_fields = ("brtarget__target", "build__project__name") | 86 | search_allowed_fields = ("brtarget__target", "build__project__name") |
87 | 87 | ||
88 | project = models.ForeignKey(Project) | 88 | project = models.ForeignKey(Project, on_delete=models.CASCADE) |
89 | build = models.OneToOneField(Build, null = True) # TODO: toasterui should set this when Build is created | 89 | build = models.OneToOneField(Build, on_delete=models.CASCADE, null = True) # TODO: toasterui should set this when Build is created |
90 | environment = models.ForeignKey(BuildEnvironment, null = True) | 90 | environment = models.ForeignKey(BuildEnvironment, on_delete=models.CASCADE, null = True) |
91 | state = models.IntegerField(choices = REQUEST_STATE, default = REQ_CREATED) | 91 | state = models.IntegerField(choices = REQUEST_STATE, default = REQ_CREATED) |
92 | created = models.DateTimeField(auto_now_add = True) | 92 | created = models.DateTimeField(auto_now_add = True) |
93 | updated = models.DateTimeField(auto_now = True) | 93 | updated = models.DateTimeField(auto_now = True) |
@@ -131,32 +131,32 @@ class BuildRequest(models.Model): | |||
131 | 131 | ||
132 | 132 | ||
133 | class BRLayer(models.Model): | 133 | class BRLayer(models.Model): |
134 | req = models.ForeignKey(BuildRequest) | 134 | req = models.ForeignKey(BuildRequest, on_delete=models.CASCADE) |
135 | name = models.CharField(max_length=100) | 135 | name = models.CharField(max_length=100) |
136 | giturl = models.CharField(max_length=254, null=True) | 136 | giturl = models.CharField(max_length=254, null=True) |
137 | local_source_dir = models.CharField(max_length=254, null=True) | 137 | local_source_dir = models.CharField(max_length=254, null=True) |
138 | commit = models.CharField(max_length=254, null=True) | 138 | commit = models.CharField(max_length=254, null=True) |
139 | dirpath = models.CharField(max_length=254, null=True) | 139 | dirpath = models.CharField(max_length=254, null=True) |
140 | layer_version = models.ForeignKey(Layer_Version, null=True) | 140 | layer_version = models.ForeignKey(Layer_Version, on_delete=models.CASCADE, null=True) |
141 | 141 | ||
142 | class BRBitbake(models.Model): | 142 | class BRBitbake(models.Model): |
143 | req = models.OneToOneField(BuildRequest) # only one bitbake for a request | 143 | req = models.OneToOneField(BuildRequest, on_delete=models.CASCADE) # only one bitbake for a request |
144 | giturl = models.CharField(max_length =254) | 144 | giturl = models.CharField(max_length =254) |
145 | commit = models.CharField(max_length = 254) | 145 | commit = models.CharField(max_length = 254) |
146 | dirpath = models.CharField(max_length = 254) | 146 | dirpath = models.CharField(max_length = 254) |
147 | 147 | ||
148 | class BRVariable(models.Model): | 148 | class BRVariable(models.Model): |
149 | req = models.ForeignKey(BuildRequest) | 149 | req = models.ForeignKey(BuildRequest, on_delete=models.CASCADE) |
150 | name = models.CharField(max_length=100) | 150 | name = models.CharField(max_length=100) |
151 | value = models.TextField(blank = True) | 151 | value = models.TextField(blank = True) |
152 | 152 | ||
153 | class BRTarget(models.Model): | 153 | class BRTarget(models.Model): |
154 | req = models.ForeignKey(BuildRequest) | 154 | req = models.ForeignKey(BuildRequest, on_delete=models.CASCADE) |
155 | target = models.CharField(max_length=100) | 155 | target = models.CharField(max_length=100) |
156 | task = models.CharField(max_length=100, null=True) | 156 | task = models.CharField(max_length=100, null=True) |
157 | 157 | ||
158 | class BRError(models.Model): | 158 | class BRError(models.Model): |
159 | req = models.ForeignKey(BuildRequest) | 159 | req = models.ForeignKey(BuildRequest, on_delete=models.CASCADE) |
160 | errtype = models.CharField(max_length=100) | 160 | errtype = models.CharField(max_length=100) |
161 | errmsg = models.TextField() | 161 | errmsg = models.TextField() |
162 | traceback = models.TextField() | 162 | traceback = models.TextField() |
diff --git a/bitbake/lib/toaster/orm/migrations/0001_initial.py b/bitbake/lib/toaster/orm/migrations/0001_initial.py index 760462f6b4..a8ac23bfc7 100644 --- a/bitbake/lib/toaster/orm/migrations/0001_initial.py +++ b/bitbake/lib/toaster/orm/migrations/0001_initial.py | |||
@@ -54,7 +54,7 @@ class Migration(migrations.Migration): | |||
54 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 54 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
55 | ('file_name', models.FilePathField()), | 55 | ('file_name', models.FilePathField()), |
56 | ('file_size', models.IntegerField()), | 56 | ('file_size', models.IntegerField()), |
57 | ('build', models.ForeignKey(to='orm.Build')), | 57 | ('build', models.ForeignKey(to='orm.Build', on_delete=models.CASCADE)), |
58 | ], | 58 | ], |
59 | ), | 59 | ), |
60 | migrations.CreateModel( | 60 | migrations.CreateModel( |
@@ -64,7 +64,7 @@ class Migration(migrations.Migration): | |||
64 | ('area', models.IntegerField(choices=[(0, b'variable')])), | 64 | ('area', models.IntegerField(choices=[(0, b'variable')])), |
65 | ('key', models.CharField(max_length=100)), | 65 | ('key', models.CharField(max_length=100)), |
66 | ('text', models.TextField()), | 66 | ('text', models.TextField()), |
67 | ('build', models.ForeignKey(related_name='helptext_build', to='orm.Build')), | 67 | ('build', models.ForeignKey(related_name='helptext_build', to='orm.Build', on_delete=models.CASCADE)), |
68 | ], | 68 | ], |
69 | ), | 69 | ), |
70 | migrations.CreateModel( | 70 | migrations.CreateModel( |
@@ -94,8 +94,8 @@ class Migration(migrations.Migration): | |||
94 | ('dirpath', models.CharField(default=None, max_length=255, null=True)), | 94 | ('dirpath', models.CharField(default=None, max_length=255, null=True)), |
95 | ('priority', models.IntegerField(default=0)), | 95 | ('priority', models.IntegerField(default=0)), |
96 | ('local_path', models.FilePathField(default=b'/', max_length=1024)), | 96 | ('local_path', models.FilePathField(default=b'/', max_length=1024)), |
97 | ('build', models.ForeignKey(related_name='layer_version_build', default=None, to='orm.Build', null=True)), | 97 | ('build', models.ForeignKey(related_name='layer_version_build', default=None, to='orm.Build', null=True, on_delete=models.CASCADE)), |
98 | ('layer', models.ForeignKey(related_name='layer_version_layer', to='orm.Layer')), | 98 | ('layer', models.ForeignKey(related_name='layer_version_layer', to='orm.Layer', on_delete=models.CASCADE)), |
99 | ], | 99 | ], |
100 | ), | 100 | ), |
101 | migrations.CreateModel( | 101 | migrations.CreateModel( |
@@ -112,9 +112,9 @@ class Migration(migrations.Migration): | |||
112 | fields=[ | 112 | fields=[ |
113 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 113 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
114 | ('up_id', models.IntegerField(default=None, null=True)), | 114 | ('up_id', models.IntegerField(default=None, null=True)), |
115 | ('depends_on', models.ForeignKey(related_name='dependees', to='orm.Layer_Version')), | 115 | ('depends_on', models.ForeignKey(related_name='dependees', to='orm.Layer_Version', on_delete=models.CASCADE)), |
116 | ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True)), | 116 | ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True, on_delete=models.CASCADE)), |
117 | ('layer_version', models.ForeignKey(related_name='dependencies', to='orm.Layer_Version')), | 117 | ('layer_version', models.ForeignKey(related_name='dependencies', to='orm.Layer_Version', on_delete=models.CASCADE)), |
118 | ], | 118 | ], |
119 | ), | 119 | ), |
120 | migrations.CreateModel( | 120 | migrations.CreateModel( |
@@ -125,7 +125,7 @@ class Migration(migrations.Migration): | |||
125 | ('message', models.TextField(null=True, blank=True)), | 125 | ('message', models.TextField(null=True, blank=True)), |
126 | ('pathname', models.FilePathField(max_length=255, blank=True)), | 126 | ('pathname', models.FilePathField(max_length=255, blank=True)), |
127 | ('lineno', models.IntegerField(null=True)), | 127 | ('lineno', models.IntegerField(null=True)), |
128 | ('build', models.ForeignKey(to='orm.Build')), | 128 | ('build', models.ForeignKey(to='orm.Build', on_delete=models.CASCADE)), |
129 | ], | 129 | ], |
130 | ), | 130 | ), |
131 | migrations.CreateModel( | 131 | migrations.CreateModel( |
@@ -136,8 +136,8 @@ class Migration(migrations.Migration): | |||
136 | ('up_date', models.DateTimeField(default=None, null=True)), | 136 | ('up_date', models.DateTimeField(default=None, null=True)), |
137 | ('name', models.CharField(max_length=255)), | 137 | ('name', models.CharField(max_length=255)), |
138 | ('description', models.CharField(max_length=255)), | 138 | ('description', models.CharField(max_length=255)), |
139 | ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True)), | 139 | ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True, on_delete=models.CASCADE)), |
140 | ('layer_version', models.ForeignKey(to='orm.Layer_Version')), | 140 | ('layer_version', models.ForeignKey(to='orm.Layer_Version', on_delete=models.CASCADE)), |
141 | ], | 141 | ], |
142 | ), | 142 | ), |
143 | migrations.CreateModel( | 143 | migrations.CreateModel( |
@@ -154,7 +154,7 @@ class Migration(migrations.Migration): | |||
154 | ('installed_size', models.IntegerField(default=0)), | 154 | ('installed_size', models.IntegerField(default=0)), |
155 | ('section', models.CharField(max_length=80, blank=True)), | 155 | ('section', models.CharField(max_length=80, blank=True)), |
156 | ('license', models.CharField(max_length=80, blank=True)), | 156 | ('license', models.CharField(max_length=80, blank=True)), |
157 | ('build', models.ForeignKey(to='orm.Build', null=True)), | 157 | ('build', models.ForeignKey(to='orm.Build', null=True, on_delete=models.CASCADE)), |
158 | ], | 158 | ], |
159 | ), | 159 | ), |
160 | migrations.CreateModel( | 160 | migrations.CreateModel( |
@@ -162,8 +162,8 @@ class Migration(migrations.Migration): | |||
162 | fields=[ | 162 | fields=[ |
163 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 163 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
164 | ('dep_type', models.IntegerField(choices=[(0, b'depends'), (1, b'depends'), (3, b'recommends'), (2, b'recommends'), (4, b'suggests'), (5, b'provides'), (6, b'replaces'), (7, b'conflicts')])), | 164 | ('dep_type', models.IntegerField(choices=[(0, b'depends'), (1, b'depends'), (3, b'recommends'), (2, b'recommends'), (4, b'suggests'), (5, b'provides'), (6, b'replaces'), (7, b'conflicts')])), |
165 | ('depends_on', models.ForeignKey(related_name='package_dependencies_target', to='orm.Package')), | 165 | ('depends_on', models.ForeignKey(related_name='package_dependencies_target', to='orm.Package', on_delete=models.CASCADE)), |
166 | ('package', models.ForeignKey(related_name='package_dependencies_source', to='orm.Package')), | 166 | ('package', models.ForeignKey(related_name='package_dependencies_source', to='orm.Package', on_delete=models.CASCADE)), |
167 | ], | 167 | ], |
168 | ), | 168 | ), |
169 | migrations.CreateModel( | 169 | migrations.CreateModel( |
@@ -172,7 +172,7 @@ class Migration(migrations.Migration): | |||
172 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 172 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
173 | ('path', models.FilePathField(max_length=255, blank=True)), | 173 | ('path', models.FilePathField(max_length=255, blank=True)), |
174 | ('size', models.IntegerField()), | 174 | ('size', models.IntegerField()), |
175 | ('package', models.ForeignKey(related_name='buildfilelist_package', to='orm.Package')), | 175 | ('package', models.ForeignKey(related_name='buildfilelist_package', to='orm.Package', on_delete=models.CASCADE)), |
176 | ], | 176 | ], |
177 | ), | 177 | ), |
178 | migrations.CreateModel( | 178 | migrations.CreateModel( |
@@ -185,7 +185,7 @@ class Migration(migrations.Migration): | |||
185 | ('updated', models.DateTimeField(auto_now=True)), | 185 | ('updated', models.DateTimeField(auto_now=True)), |
186 | ('user_id', models.IntegerField(null=True)), | 186 | ('user_id', models.IntegerField(null=True)), |
187 | ('is_default', models.BooleanField(default=False)), | 187 | ('is_default', models.BooleanField(default=False)), |
188 | ('bitbake_version', models.ForeignKey(to='orm.BitbakeVersion', null=True)), | 188 | ('bitbake_version', models.ForeignKey(to='orm.BitbakeVersion', null=True, on_delete=models.CASCADE)), |
189 | ], | 189 | ], |
190 | ), | 190 | ), |
191 | migrations.CreateModel( | 191 | migrations.CreateModel( |
@@ -193,8 +193,8 @@ class Migration(migrations.Migration): | |||
193 | fields=[ | 193 | fields=[ |
194 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 194 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
195 | ('optional', models.BooleanField(default=True)), | 195 | ('optional', models.BooleanField(default=True)), |
196 | ('layercommit', models.ForeignKey(to='orm.Layer_Version', null=True)), | 196 | ('layercommit', models.ForeignKey(to='orm.Layer_Version', null=True, on_delete=models.CASCADE)), |
197 | ('project', models.ForeignKey(to='orm.Project')), | 197 | ('project', models.ForeignKey(to='orm.Project', on_delete=models.CASCADE)), |
198 | ], | 198 | ], |
199 | ), | 199 | ), |
200 | migrations.CreateModel( | 200 | migrations.CreateModel( |
@@ -203,7 +203,7 @@ class Migration(migrations.Migration): | |||
203 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 203 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
204 | ('target', models.CharField(max_length=100)), | 204 | ('target', models.CharField(max_length=100)), |
205 | ('task', models.CharField(max_length=100, null=True)), | 205 | ('task', models.CharField(max_length=100, null=True)), |
206 | ('project', models.ForeignKey(to='orm.Project')), | 206 | ('project', models.ForeignKey(to='orm.Project', on_delete=models.CASCADE)), |
207 | ], | 207 | ], |
208 | ), | 208 | ), |
209 | migrations.CreateModel( | 209 | migrations.CreateModel( |
@@ -212,7 +212,7 @@ class Migration(migrations.Migration): | |||
212 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 212 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
213 | ('name', models.CharField(max_length=100)), | 213 | ('name', models.CharField(max_length=100)), |
214 | ('value', models.TextField(blank=True)), | 214 | ('value', models.TextField(blank=True)), |
215 | ('project', models.ForeignKey(to='orm.Project')), | 215 | ('project', models.ForeignKey(to='orm.Project', on_delete=models.CASCADE)), |
216 | ], | 216 | ], |
217 | ), | 217 | ), |
218 | migrations.CreateModel( | 218 | migrations.CreateModel( |
@@ -232,8 +232,8 @@ class Migration(migrations.Migration): | |||
232 | ('file_path', models.FilePathField(max_length=255)), | 232 | ('file_path', models.FilePathField(max_length=255)), |
233 | ('pathflags', models.CharField(max_length=200, blank=True)), | 233 | ('pathflags', models.CharField(max_length=200, blank=True)), |
234 | ('is_image', models.BooleanField(default=False)), | 234 | ('is_image', models.BooleanField(default=False)), |
235 | ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True)), | 235 | ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True, on_delete=models.CASCADE)), |
236 | ('layer_version', models.ForeignKey(related_name='recipe_layer_version', to='orm.Layer_Version')), | 236 | ('layer_version', models.ForeignKey(related_name='recipe_layer_version', to='orm.Layer_Version', on_delete=models.CASCADE)), |
237 | ], | 237 | ], |
238 | ), | 238 | ), |
239 | migrations.CreateModel( | 239 | migrations.CreateModel( |
@@ -241,8 +241,8 @@ class Migration(migrations.Migration): | |||
241 | fields=[ | 241 | fields=[ |
242 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 242 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
243 | ('dep_type', models.IntegerField(choices=[(0, b'depends'), (1, b'rdepends')])), | 243 | ('dep_type', models.IntegerField(choices=[(0, b'depends'), (1, b'rdepends')])), |
244 | ('depends_on', models.ForeignKey(related_name='r_dependencies_depends', to='orm.Recipe')), | 244 | ('depends_on', models.ForeignKey(related_name='r_dependencies_depends', to='orm.Recipe', on_delete=models.CASCADE)), |
245 | ('recipe', models.ForeignKey(related_name='r_dependencies_recipe', to='orm.Recipe')), | 245 | ('recipe', models.ForeignKey(related_name='r_dependencies_recipe', to='orm.Recipe', on_delete=models.CASCADE)), |
246 | ], | 246 | ], |
247 | ), | 247 | ), |
248 | migrations.CreateModel( | 248 | migrations.CreateModel( |
@@ -253,7 +253,7 @@ class Migration(migrations.Migration): | |||
253 | ('description', models.CharField(max_length=255)), | 253 | ('description', models.CharField(max_length=255)), |
254 | ('branch_name', models.CharField(default=b'', max_length=50)), | 254 | ('branch_name', models.CharField(default=b'', max_length=50)), |
255 | ('helptext', models.TextField(null=True)), | 255 | ('helptext', models.TextField(null=True)), |
256 | ('bitbake_version', models.ForeignKey(to='orm.BitbakeVersion')), | 256 | ('bitbake_version', models.ForeignKey(to='orm.BitbakeVersion', on_delete=models.CASCADE)), |
257 | ], | 257 | ], |
258 | ), | 258 | ), |
259 | migrations.CreateModel( | 259 | migrations.CreateModel( |
@@ -261,7 +261,7 @@ class Migration(migrations.Migration): | |||
261 | fields=[ | 261 | fields=[ |
262 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 262 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
263 | ('layer_name', models.CharField(default=b'', max_length=100)), | 263 | ('layer_name', models.CharField(default=b'', max_length=100)), |
264 | ('release', models.ForeignKey(to='orm.Release')), | 264 | ('release', models.ForeignKey(to='orm.Release', on_delete=models.CASCADE)), |
265 | ], | 265 | ], |
266 | ), | 266 | ), |
267 | migrations.CreateModel( | 267 | migrations.CreateModel( |
@@ -269,8 +269,8 @@ class Migration(migrations.Migration): | |||
269 | fields=[ | 269 | fields=[ |
270 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 270 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
271 | ('priority', models.IntegerField(default=0)), | 271 | ('priority', models.IntegerField(default=0)), |
272 | ('layer_source', models.ForeignKey(to='orm.LayerSource')), | 272 | ('layer_source', models.ForeignKey(to='orm.LayerSource', on_delete=models.CASCADE)), |
273 | ('release', models.ForeignKey(to='orm.Release')), | 273 | ('release', models.ForeignKey(to='orm.Release', on_delete=models.CASCADE)), |
274 | ], | 274 | ], |
275 | ), | 275 | ), |
276 | migrations.CreateModel( | 276 | migrations.CreateModel( |
@@ -282,7 +282,7 @@ class Migration(migrations.Migration): | |||
282 | ('is_image', models.BooleanField(default=False)), | 282 | ('is_image', models.BooleanField(default=False)), |
283 | ('image_size', models.IntegerField(default=0)), | 283 | ('image_size', models.IntegerField(default=0)), |
284 | ('license_manifest_path', models.CharField(max_length=500, null=True)), | 284 | ('license_manifest_path', models.CharField(max_length=500, null=True)), |
285 | ('build', models.ForeignKey(to='orm.Build')), | 285 | ('build', models.ForeignKey(to='orm.Build', on_delete=models.CASCADE)), |
286 | ], | 286 | ], |
287 | ), | 287 | ), |
288 | migrations.CreateModel( | 288 | migrations.CreateModel( |
@@ -295,9 +295,9 @@ class Migration(migrations.Migration): | |||
295 | ('permission', models.CharField(max_length=16)), | 295 | ('permission', models.CharField(max_length=16)), |
296 | ('owner', models.CharField(max_length=128)), | 296 | ('owner', models.CharField(max_length=128)), |
297 | ('group', models.CharField(max_length=128)), | 297 | ('group', models.CharField(max_length=128)), |
298 | ('directory', models.ForeignKey(related_name='directory_set', to='orm.Target_File', null=True)), | 298 | ('directory', models.ForeignKey(related_name='directory_set', to='orm.Target_File', null=True, on_delete=models.CASCADE)), |
299 | ('sym_target', models.ForeignKey(related_name='symlink_set', to='orm.Target_File', null=True)), | 299 | ('sym_target', models.ForeignKey(related_name='symlink_set', to='orm.Target_File', null=True, on_delete=models.CASCADE)), |
300 | ('target', models.ForeignKey(to='orm.Target')), | 300 | ('target', models.ForeignKey(to='orm.Target', on_delete=models.CASCADE)), |
301 | ], | 301 | ], |
302 | ), | 302 | ), |
303 | migrations.CreateModel( | 303 | migrations.CreateModel( |
@@ -306,15 +306,15 @@ class Migration(migrations.Migration): | |||
306 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 306 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
307 | ('file_name', models.FilePathField(max_length=254)), | 307 | ('file_name', models.FilePathField(max_length=254)), |
308 | ('file_size', models.IntegerField()), | 308 | ('file_size', models.IntegerField()), |
309 | ('target', models.ForeignKey(to='orm.Target')), | 309 | ('target', models.ForeignKey(to='orm.Target', on_delete=models.CASCADE)), |
310 | ], | 310 | ], |
311 | ), | 311 | ), |
312 | migrations.CreateModel( | 312 | migrations.CreateModel( |
313 | name='Target_Installed_Package', | 313 | name='Target_Installed_Package', |
314 | fields=[ | 314 | fields=[ |
315 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 315 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
316 | ('package', models.ForeignKey(related_name='buildtargetlist_package', to='orm.Package')), | 316 | ('package', models.ForeignKey(related_name='buildtargetlist_package', to='orm.Package', on_delete=models.CASCADE)), |
317 | ('target', models.ForeignKey(to='orm.Target')), | 317 | ('target', models.ForeignKey(to='orm.Target', on_delete=models.CASCADE)), |
318 | ], | 318 | ], |
319 | ), | 319 | ), |
320 | migrations.CreateModel( | 320 | migrations.CreateModel( |
@@ -337,8 +337,8 @@ class Migration(migrations.Migration): | |||
337 | ('sstate_result', models.IntegerField(default=0, choices=[(0, b'Not Applicable'), (1, b'File not in cache'), (2, b'Failed'), (3, b'Succeeded')])), | 337 | ('sstate_result', models.IntegerField(default=0, choices=[(0, b'Not Applicable'), (1, b'File not in cache'), (2, b'Failed'), (3, b'Succeeded')])), |
338 | ('message', models.CharField(max_length=240)), | 338 | ('message', models.CharField(max_length=240)), |
339 | ('logfile', models.FilePathField(max_length=255, blank=True)), | 339 | ('logfile', models.FilePathField(max_length=255, blank=True)), |
340 | ('build', models.ForeignKey(related_name='task_build', to='orm.Build')), | 340 | ('build', models.ForeignKey(related_name='task_build', to='orm.Build', on_delete=models.CASCADE)), |
341 | ('recipe', models.ForeignKey(related_name='tasks', to='orm.Recipe')), | 341 | ('recipe', models.ForeignKey(related_name='tasks', to='orm.Recipe', on_delete=models.CASCADE)), |
342 | ], | 342 | ], |
343 | options={ | 343 | options={ |
344 | 'ordering': ('order', 'recipe'), | 344 | 'ordering': ('order', 'recipe'), |
@@ -348,8 +348,8 @@ class Migration(migrations.Migration): | |||
348 | name='Task_Dependency', | 348 | name='Task_Dependency', |
349 | fields=[ | 349 | fields=[ |
350 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 350 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
351 | ('depends_on', models.ForeignKey(related_name='task_dependencies_depends', to='orm.Task')), | 351 | ('depends_on', models.ForeignKey(related_name='task_dependencies_depends', to='orm.Task', on_delete=models.CASCADE)), |
352 | ('task', models.ForeignKey(related_name='task_dependencies_task', to='orm.Task')), | 352 | ('task', models.ForeignKey(related_name='task_dependencies_task', to='orm.Task', on_delete=models.CASCADE)), |
353 | ], | 353 | ], |
354 | ), | 354 | ), |
355 | migrations.CreateModel( | 355 | migrations.CreateModel( |
@@ -370,7 +370,7 @@ class Migration(migrations.Migration): | |||
370 | ('changed', models.BooleanField(default=False)), | 370 | ('changed', models.BooleanField(default=False)), |
371 | ('human_readable_name', models.CharField(max_length=200)), | 371 | ('human_readable_name', models.CharField(max_length=200)), |
372 | ('description', models.TextField(blank=True)), | 372 | ('description', models.TextField(blank=True)), |
373 | ('build', models.ForeignKey(related_name='variable_build', to='orm.Build')), | 373 | ('build', models.ForeignKey(related_name='variable_build', to='orm.Build', on_delete=models.CASCADE)), |
374 | ], | 374 | ], |
375 | ), | 375 | ), |
376 | migrations.CreateModel( | 376 | migrations.CreateModel( |
@@ -381,28 +381,28 @@ class Migration(migrations.Migration): | |||
381 | ('file_name', models.FilePathField(max_length=255)), | 381 | ('file_name', models.FilePathField(max_length=255)), |
382 | ('line_number', models.IntegerField(null=True)), | 382 | ('line_number', models.IntegerField(null=True)), |
383 | ('operation', models.CharField(max_length=64)), | 383 | ('operation', models.CharField(max_length=64)), |
384 | ('variable', models.ForeignKey(related_name='vhistory', to='orm.Variable')), | 384 | ('variable', models.ForeignKey(related_name='vhistory', to='orm.Variable', on_delete=models.CASCADE)), |
385 | ], | 385 | ], |
386 | ), | 386 | ), |
387 | migrations.AddField( | 387 | migrations.AddField( |
388 | model_name='project', | 388 | model_name='project', |
389 | name='release', | 389 | name='release', |
390 | field=models.ForeignKey(to='orm.Release', null=True), | 390 | field=models.ForeignKey(to='orm.Release', null=True, on_delete=models.CASCADE), |
391 | ), | 391 | ), |
392 | migrations.AddField( | 392 | migrations.AddField( |
393 | model_name='package_dependency', | 393 | model_name='package_dependency', |
394 | name='target', | 394 | name='target', |
395 | field=models.ForeignKey(to='orm.Target', null=True), | 395 | field=models.ForeignKey(to='orm.Target', null=True, on_delete=models.CASCADE), |
396 | ), | 396 | ), |
397 | migrations.AddField( | 397 | migrations.AddField( |
398 | model_name='package', | 398 | model_name='package', |
399 | name='recipe', | 399 | name='recipe', |
400 | field=models.ForeignKey(to='orm.Recipe', null=True), | 400 | field=models.ForeignKey(to='orm.Recipe', null=True, on_delete=models.CASCADE), |
401 | ), | 401 | ), |
402 | migrations.AddField( | 402 | migrations.AddField( |
403 | model_name='logmessage', | 403 | model_name='logmessage', |
404 | name='task', | 404 | name='task', |
405 | field=models.ForeignKey(blank=True, to='orm.Task', null=True), | 405 | field=models.ForeignKey(blank=True, to='orm.Task', null=True, on_delete=models.CASCADE), |
406 | ), | 406 | ), |
407 | migrations.AlterUniqueTogether( | 407 | migrations.AlterUniqueTogether( |
408 | name='layersource', | 408 | name='layersource', |
@@ -411,32 +411,32 @@ class Migration(migrations.Migration): | |||
411 | migrations.AddField( | 411 | migrations.AddField( |
412 | model_name='layer_version', | 412 | model_name='layer_version', |
413 | name='layer_source', | 413 | name='layer_source', |
414 | field=models.ForeignKey(default=None, to='orm.LayerSource', null=True), | 414 | field=models.ForeignKey(default=None, to='orm.LayerSource', null=True, on_delete=models.CASCADE), |
415 | ), | 415 | ), |
416 | migrations.AddField( | 416 | migrations.AddField( |
417 | model_name='layer_version', | 417 | model_name='layer_version', |
418 | name='project', | 418 | name='project', |
419 | field=models.ForeignKey(default=None, to='orm.Project', null=True), | 419 | field=models.ForeignKey(default=None, to='orm.Project', null=True, on_delete=models.CASCADE), |
420 | ), | 420 | ), |
421 | migrations.AddField( | 421 | migrations.AddField( |
422 | model_name='layer_version', | 422 | model_name='layer_version', |
423 | name='up_branch', | 423 | name='up_branch', |
424 | field=models.ForeignKey(default=None, to='orm.Branch', null=True), | 424 | field=models.ForeignKey(default=None, to='orm.Branch', null=True, on_delete=models.CASCADE), |
425 | ), | 425 | ), |
426 | migrations.AddField( | 426 | migrations.AddField( |
427 | model_name='layer', | 427 | model_name='layer', |
428 | name='layer_source', | 428 | name='layer_source', |
429 | field=models.ForeignKey(default=None, to='orm.LayerSource', null=True), | 429 | field=models.ForeignKey(default=None, to='orm.LayerSource', null=True, on_delete=models.CASCADE), |
430 | ), | 430 | ), |
431 | migrations.AddField( | 431 | migrations.AddField( |
432 | model_name='build', | 432 | model_name='build', |
433 | name='project', | 433 | name='project', |
434 | field=models.ForeignKey(to='orm.Project'), | 434 | field=models.ForeignKey(to='orm.Project', on_delete=models.CASCADE), |
435 | ), | 435 | ), |
436 | migrations.AddField( | 436 | migrations.AddField( |
437 | model_name='branch', | 437 | model_name='branch', |
438 | name='layer_source', | 438 | name='layer_source', |
439 | field=models.ForeignKey(default=True, to='orm.LayerSource', null=True), | 439 | field=models.ForeignKey(default=True, to='orm.LayerSource', null=True, on_delete=models.CASCADE), |
440 | ), | 440 | ), |
441 | migrations.CreateModel( | 441 | migrations.CreateModel( |
442 | name='ImportedLayerSource', | 442 | name='ImportedLayerSource', |
diff --git a/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py b/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py index 9cec82e8d4..09c2bffa28 100644 --- a/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py +++ b/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py | |||
@@ -14,10 +14,10 @@ class Migration(migrations.Migration): | |||
14 | migrations.CreateModel( | 14 | migrations.CreateModel( |
15 | name='CustomImageRecipe', | 15 | name='CustomImageRecipe', |
16 | fields=[ | 16 | fields=[ |
17 | ('recipe_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Recipe')), | 17 | ('recipe_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Recipe', on_delete=models.CASCADE)), |
18 | ('last_updated', models.DateTimeField(default=None, null=True)), | 18 | ('last_updated', models.DateTimeField(default=None, null=True)), |
19 | ('base_recipe', models.ForeignKey(related_name='based_on_recipe', to='orm.Recipe')), | 19 | ('base_recipe', models.ForeignKey(related_name='based_on_recipe', to='orm.Recipe', on_delete=models.CASCADE)), |
20 | ('project', models.ForeignKey(to='orm.Project')), | 20 | ('project', models.ForeignKey(to='orm.Project', on_delete=models.CASCADE)), |
21 | ], | 21 | ], |
22 | bases=('orm.recipe',), | 22 | bases=('orm.recipe',), |
23 | ), | 23 | ), |
diff --git a/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py b/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py index b027f66137..8cb81d7b5e 100644 --- a/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py +++ b/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py | |||
@@ -14,7 +14,7 @@ class Migration(migrations.Migration): | |||
14 | migrations.CreateModel( | 14 | migrations.CreateModel( |
15 | name='CustomImagePackage', | 15 | name='CustomImagePackage', |
16 | fields=[ | 16 | fields=[ |
17 | ('package_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Package')), | 17 | ('package_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Package', on_delete=models.CASCADE)), |
18 | ('recipe_appends', models.ManyToManyField(related_name='appends_set', to='orm.CustomImageRecipe')), | 18 | ('recipe_appends', models.ManyToManyField(related_name='appends_set', to='orm.CustomImageRecipe')), |
19 | ('recipe_excludes', models.ManyToManyField(related_name='excludes_set', to='orm.CustomImageRecipe')), | 19 | ('recipe_excludes', models.ManyToManyField(related_name='excludes_set', to='orm.CustomImageRecipe')), |
20 | ('recipe_includes', models.ManyToManyField(related_name='includes_set', to='orm.CustomImageRecipe')), | 20 | ('recipe_includes', models.ManyToManyField(related_name='includes_set', to='orm.CustomImageRecipe')), |
diff --git a/bitbake/lib/toaster/orm/migrations/0004_provides.py b/bitbake/lib/toaster/orm/migrations/0004_provides.py index dfde2d1361..8449604989 100644 --- a/bitbake/lib/toaster/orm/migrations/0004_provides.py +++ b/bitbake/lib/toaster/orm/migrations/0004_provides.py | |||
@@ -16,12 +16,12 @@ class Migration(migrations.Migration): | |||
16 | fields=[ | 16 | fields=[ |
17 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | 17 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
18 | ('name', models.CharField(max_length=100)), | 18 | ('name', models.CharField(max_length=100)), |
19 | ('recipe', models.ForeignKey(to='orm.Recipe')), | 19 | ('recipe', models.ForeignKey(to='orm.Recipe', on_delete=models.CASCADE)), |
20 | ], | 20 | ], |
21 | ), | 21 | ), |
22 | migrations.AddField( | 22 | migrations.AddField( |
23 | model_name='recipe_dependency', | 23 | model_name='recipe_dependency', |
24 | name='via', | 24 | name='via', |
25 | field=models.ForeignKey(null=True, default=None, to='orm.Provides'), | 25 | field=models.ForeignKey(null=True, default=None, to='orm.Provides', on_delete=models.CASCADE), |
26 | ), | 26 | ), |
27 | ] | 27 | ] |
diff --git a/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py b/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py index 3367582a81..41a547a60e 100644 --- a/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py +++ b/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py | |||
@@ -17,7 +17,7 @@ class Migration(migrations.Migration): | |||
17 | ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), | 17 | ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), |
18 | ('file_name', models.FilePathField()), | 18 | ('file_name', models.FilePathField()), |
19 | ('file_size', models.IntegerField()), | 19 | ('file_size', models.IntegerField()), |
20 | ('target', models.ForeignKey(to='orm.Target')), | 20 | ('target', models.ForeignKey(to='orm.Target', on_delete=models.CASCADE)), |
21 | ], | 21 | ], |
22 | ), | 22 | ), |
23 | migrations.CreateModel( | 23 | migrations.CreateModel( |
@@ -26,7 +26,7 @@ class Migration(migrations.Migration): | |||
26 | ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), | 26 | ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), |
27 | ('file_name', models.FilePathField()), | 27 | ('file_name', models.FilePathField()), |
28 | ('file_size', models.IntegerField()), | 28 | ('file_size', models.IntegerField()), |
29 | ('target', models.ForeignKey(to='orm.Target')), | 29 | ('target', models.ForeignKey(to='orm.Target', on_delete=models.CASCADE)), |
30 | ], | 30 | ], |
31 | ), | 31 | ), |
32 | migrations.RemoveField( | 32 | migrations.RemoveField( |
diff --git a/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py b/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py index 0e6bb83311..4b96bf0969 100644 --- a/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py +++ b/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py | |||
@@ -46,7 +46,7 @@ class Migration(migrations.Migration): | |||
46 | migrations.AddField( | 46 | migrations.AddField( |
47 | model_name='layer_version', | 47 | model_name='layer_version', |
48 | name='release', | 48 | name='release', |
49 | field=models.ForeignKey(to='orm.Release', default=None, null=True), | 49 | field=models.ForeignKey(to='orm.Release', default=None, null=True, on_delete=models.CASCADE), |
50 | ), | 50 | ), |
51 | migrations.RunPython(branch_to_release, | 51 | migrations.RunPython(branch_to_release, |
52 | reverse_code=migrations.RunPython.noop), | 52 | reverse_code=migrations.RunPython.noop), |
diff --git a/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py b/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py index d3c5901275..731c0debd2 100644 --- a/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py +++ b/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py | |||
@@ -18,7 +18,7 @@ class Migration(migrations.Migration): | |||
18 | ('up_date', models.DateTimeField(default=None, null=True)), | 18 | ('up_date', models.DateTimeField(default=None, null=True)), |
19 | ('name', models.CharField(max_length=255)), | 19 | ('name', models.CharField(max_length=255)), |
20 | ('description', models.CharField(max_length=255)), | 20 | ('description', models.CharField(max_length=255)), |
21 | ('layer_version', models.ForeignKey(to='orm.Layer_Version')), | 21 | ('layer_version', models.ForeignKey(to='orm.Layer_Version', on_delete=models.CASCADE)), |
22 | ], | 22 | ], |
23 | ), | 23 | ), |
24 | ] | 24 | ] |
diff --git a/bitbake/lib/toaster/orm/migrations/0019_django_2_2.py b/bitbake/lib/toaster/orm/migrations/0019_django_2_2.py new file mode 100644 index 0000000000..666aef18be --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0019_django_2_2.py | |||
@@ -0,0 +1,23 @@ | |||
1 | # Generated by Django 2.2.7 on 2019-11-19 03:38 | ||
2 | |||
3 | from django.db import migrations, models | ||
4 | import django.db.models.deletion | ||
5 | |||
6 | |||
7 | class Migration(migrations.Migration): | ||
8 | |||
9 | dependencies = [ | ||
10 | ('orm', '0018_project_specific'), | ||
11 | ] | ||
12 | |||
13 | operations = [ | ||
14 | migrations.RemoveField( | ||
15 | model_name='distro', | ||
16 | name='up_id', | ||
17 | ), | ||
18 | migrations.AlterField( | ||
19 | model_name='build', | ||
20 | name='recipes_parsed', | ||
21 | field=models.IntegerField(default=1), | ||
22 | ), | ||
23 | ] | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index caf069721a..7f7e922ade 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -13,7 +13,7 @@ from django.db.models import F, Q, Sum, Count | |||
13 | from django.utils import timezone | 13 | from django.utils import timezone |
14 | from django.utils.encoding import force_bytes | 14 | from django.utils.encoding import force_bytes |
15 | 15 | ||
16 | from django.core.urlresolvers import reverse | 16 | from django.urls import reverse |
17 | 17 | ||
18 | from django.core import validators | 18 | from django.core import validators |
19 | from django.conf import settings | 19 | from django.conf import settings |
@@ -178,8 +178,8 @@ class Project(models.Model): | |||
178 | 'release__branch_name'] | 178 | 'release__branch_name'] |
179 | name = models.CharField(max_length=100) | 179 | name = models.CharField(max_length=100) |
180 | short_description = models.CharField(max_length=50, blank=True) | 180 | short_description = models.CharField(max_length=50, blank=True) |
181 | bitbake_version = models.ForeignKey('BitbakeVersion', null=True) | 181 | bitbake_version = models.ForeignKey('BitbakeVersion', on_delete=models.CASCADE, null=True) |
182 | release = models.ForeignKey("Release", null=True) | 182 | release = models.ForeignKey("Release", on_delete=models.CASCADE, null=True) |
183 | created = models.DateTimeField(auto_now_add=True) | 183 | created = models.DateTimeField(auto_now_add=True) |
184 | updated = models.DateTimeField(auto_now=True) | 184 | updated = models.DateTimeField(auto_now=True) |
185 | # This is a horrible hack; since Toaster has no "User" model available when | 185 | # This is a horrible hack; since Toaster has no "User" model available when |
@@ -469,7 +469,7 @@ class Build(models.Model): | |||
469 | 469 | ||
470 | search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] | 470 | search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] |
471 | 471 | ||
472 | project = models.ForeignKey(Project) # must have a project | 472 | project = models.ForeignKey(Project, on_delete=models.CASCADE) # must have a project |
473 | machine = models.CharField(max_length=100) | 473 | machine = models.CharField(max_length=100) |
474 | distro = models.CharField(max_length=100) | 474 | distro = models.CharField(max_length=100) |
475 | distro_version = models.CharField(max_length=100) | 475 | distro_version = models.CharField(max_length=100) |
@@ -777,13 +777,13 @@ class Build(models.Model): | |||
777 | return "%d %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()])) | 777 | return "%d %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()])) |
778 | 778 | ||
779 | class ProjectTarget(models.Model): | 779 | class ProjectTarget(models.Model): |
780 | project = models.ForeignKey(Project) | 780 | project = models.ForeignKey(Project, on_delete=models.CASCADE) |
781 | target = models.CharField(max_length=100) | 781 | target = models.CharField(max_length=100) |
782 | task = models.CharField(max_length=100, null=True) | 782 | task = models.CharField(max_length=100, null=True) |
783 | 783 | ||
784 | class Target(models.Model): | 784 | class Target(models.Model): |
785 | search_allowed_fields = ['target', 'file_name'] | 785 | search_allowed_fields = ['target', 'file_name'] |
786 | build = models.ForeignKey(Build) | 786 | build = models.ForeignKey(Build, on_delete=models.CASCADE) |
787 | target = models.CharField(max_length=100) | 787 | target = models.CharField(max_length=100) |
788 | task = models.CharField(max_length=100, null=True) | 788 | task = models.CharField(max_length=100, null=True) |
789 | is_image = models.BooleanField(default = False) | 789 | is_image = models.BooleanField(default = False) |
@@ -944,7 +944,7 @@ class Target(models.Model): | |||
944 | 944 | ||
945 | # kernel artifacts for a target: bzImage and modules* | 945 | # kernel artifacts for a target: bzImage and modules* |
946 | class TargetKernelFile(models.Model): | 946 | class TargetKernelFile(models.Model): |
947 | target = models.ForeignKey(Target) | 947 | target = models.ForeignKey(Target, on_delete=models.CASCADE) |
948 | file_name = models.FilePathField() | 948 | file_name = models.FilePathField() |
949 | file_size = models.IntegerField() | 949 | file_size = models.IntegerField() |
950 | 950 | ||
@@ -954,7 +954,7 @@ class TargetKernelFile(models.Model): | |||
954 | 954 | ||
955 | # SDK artifacts for a target: sh and manifest files | 955 | # SDK artifacts for a target: sh and manifest files |
956 | class TargetSDKFile(models.Model): | 956 | class TargetSDKFile(models.Model): |
957 | target = models.ForeignKey(Target) | 957 | target = models.ForeignKey(Target, on_delete=models.CASCADE) |
958 | file_name = models.FilePathField() | 958 | file_name = models.FilePathField() |
959 | file_size = models.IntegerField() | 959 | file_size = models.IntegerField() |
960 | 960 | ||
@@ -973,7 +973,7 @@ class Target_Image_File(models.Model): | |||
973 | 'ubifs', 'wic', 'wic.bz2', 'wic.gz', 'wic.lzma' | 973 | 'ubifs', 'wic', 'wic.bz2', 'wic.gz', 'wic.lzma' |
974 | } | 974 | } |
975 | 975 | ||
976 | target = models.ForeignKey(Target) | 976 | target = models.ForeignKey(Target, on_delete=models.CASCADE) |
977 | file_name = models.FilePathField(max_length=254) | 977 | file_name = models.FilePathField(max_length=254) |
978 | file_size = models.IntegerField() | 978 | file_size = models.IntegerField() |
979 | 979 | ||
@@ -1007,15 +1007,15 @@ class Target_File(models.Model): | |||
1007 | ( ITYPE_BLOCK ,'block'), | 1007 | ( ITYPE_BLOCK ,'block'), |
1008 | ) | 1008 | ) |
1009 | 1009 | ||
1010 | target = models.ForeignKey(Target) | 1010 | target = models.ForeignKey(Target, on_delete=models.CASCADE) |
1011 | path = models.FilePathField() | 1011 | path = models.FilePathField() |
1012 | size = models.IntegerField() | 1012 | size = models.IntegerField() |
1013 | inodetype = models.IntegerField(choices = ITYPES) | 1013 | inodetype = models.IntegerField(choices = ITYPES) |
1014 | permission = models.CharField(max_length=16) | 1014 | permission = models.CharField(max_length=16) |
1015 | owner = models.CharField(max_length=128) | 1015 | owner = models.CharField(max_length=128) |
1016 | group = models.CharField(max_length=128) | 1016 | group = models.CharField(max_length=128) |
1017 | directory = models.ForeignKey('Target_File', related_name="directory_set", null=True) | 1017 | directory = models.ForeignKey('Target_File', on_delete=models.CASCADE, related_name="directory_set", null=True) |
1018 | sym_target = models.ForeignKey('Target_File', related_name="symlink_set", null=True) | 1018 | sym_target = models.ForeignKey('Target_File', on_delete=models.CASCADE, related_name="symlink_set", null=True) |
1019 | 1019 | ||
1020 | 1020 | ||
1021 | class Task(models.Model): | 1021 | class Task(models.Model): |
@@ -1102,13 +1102,13 @@ class Task(models.Model): | |||
1102 | def get_description(self): | 1102 | def get_description(self): |
1103 | return self._helptext | 1103 | return self._helptext |
1104 | 1104 | ||
1105 | build = models.ForeignKey(Build, related_name='task_build') | 1105 | build = models.ForeignKey(Build, on_delete=models.CASCADE, related_name='task_build') |
1106 | order = models.IntegerField(null=True) | 1106 | order = models.IntegerField(null=True) |
1107 | task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed | 1107 | task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed |
1108 | outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA) | 1108 | outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA) |
1109 | sstate_checksum = models.CharField(max_length=100, blank=True) | 1109 | sstate_checksum = models.CharField(max_length=100, blank=True) |
1110 | path_to_sstate_obj = models.FilePathField(max_length=500, blank=True) | 1110 | path_to_sstate_obj = models.FilePathField(max_length=500, blank=True) |
1111 | recipe = models.ForeignKey('Recipe', related_name='tasks') | 1111 | recipe = models.ForeignKey('Recipe', on_delete=models.CASCADE, related_name='tasks') |
1112 | task_name = models.CharField(max_length=100) | 1112 | task_name = models.CharField(max_length=100) |
1113 | source_url = models.FilePathField(max_length=255, blank=True) | 1113 | source_url = models.FilePathField(max_length=255, blank=True) |
1114 | work_directory = models.FilePathField(max_length=255, blank=True) | 1114 | work_directory = models.FilePathField(max_length=255, blank=True) |
@@ -1147,13 +1147,13 @@ class Task(models.Model): | |||
1147 | 1147 | ||
1148 | 1148 | ||
1149 | class Task_Dependency(models.Model): | 1149 | class Task_Dependency(models.Model): |
1150 | task = models.ForeignKey(Task, related_name='task_dependencies_task') | 1150 | task = models.ForeignKey(Task, on_delete=models.CASCADE, related_name='task_dependencies_task') |
1151 | depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends') | 1151 | depends_on = models.ForeignKey(Task, on_delete=models.CASCADE, related_name='task_dependencies_depends') |
1152 | 1152 | ||
1153 | class Package(models.Model): | 1153 | class Package(models.Model): |
1154 | search_allowed_fields = ['name', 'version', 'revision', 'recipe__name', 'recipe__version', 'recipe__license', 'recipe__layer_version__layer__name', 'recipe__layer_version__branch', 'recipe__layer_version__commit', 'recipe__layer_version__local_path', 'installed_name'] | 1154 | search_allowed_fields = ['name', 'version', 'revision', 'recipe__name', 'recipe__version', 'recipe__license', 'recipe__layer_version__layer__name', 'recipe__layer_version__branch', 'recipe__layer_version__commit', 'recipe__layer_version__local_path', 'installed_name'] |
1155 | build = models.ForeignKey('Build', null=True) | 1155 | build = models.ForeignKey('Build', on_delete=models.CASCADE, null=True) |
1156 | recipe = models.ForeignKey('Recipe', null=True) | 1156 | recipe = models.ForeignKey('Recipe', on_delete=models.CASCADE, null=True) |
1157 | name = models.CharField(max_length=100) | 1157 | name = models.CharField(max_length=100) |
1158 | installed_name = models.CharField(max_length=100, default='') | 1158 | installed_name = models.CharField(max_length=100, default='') |
1159 | version = models.CharField(max_length=100, blank=True) | 1159 | version = models.CharField(max_length=100, blank=True) |
@@ -1289,19 +1289,19 @@ class Package_Dependency(models.Model): | |||
1289 | TYPE_RCONFLICTS : ("conflicts", "%s conflicts with %s, which will not be installed if this package is not first removed"), | 1289 | TYPE_RCONFLICTS : ("conflicts", "%s conflicts with %s, which will not be installed if this package is not first removed"), |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | package = models.ForeignKey(Package, related_name='package_dependencies_source') | 1292 | package = models.ForeignKey(Package, on_delete=models.CASCADE, related_name='package_dependencies_source') |
1293 | depends_on = models.ForeignKey(Package, related_name='package_dependencies_target') # soft dependency | 1293 | depends_on = models.ForeignKey(Package, on_delete=models.CASCADE, related_name='package_dependencies_target') # soft dependency |
1294 | dep_type = models.IntegerField(choices=DEPENDS_TYPE) | 1294 | dep_type = models.IntegerField(choices=DEPENDS_TYPE) |
1295 | target = models.ForeignKey(Target, null=True) | 1295 | target = models.ForeignKey(Target, on_delete=models.CASCADE, null=True) |
1296 | objects = Package_DependencyManager() | 1296 | objects = Package_DependencyManager() |
1297 | 1297 | ||
1298 | class Target_Installed_Package(models.Model): | 1298 | class Target_Installed_Package(models.Model): |
1299 | target = models.ForeignKey(Target) | 1299 | target = models.ForeignKey(Target, on_delete=models.CASCADE) |
1300 | package = models.ForeignKey(Package, related_name='buildtargetlist_package') | 1300 | package = models.ForeignKey(Package, on_delete=models.CASCADE, related_name='buildtargetlist_package') |
1301 | 1301 | ||
1302 | 1302 | ||
1303 | class Package_File(models.Model): | 1303 | class Package_File(models.Model): |
1304 | package = models.ForeignKey(Package, related_name='buildfilelist_package') | 1304 | package = models.ForeignKey(Package, on_delete=models.CASCADE, related_name='buildfilelist_package') |
1305 | path = models.FilePathField(max_length=255, blank=True) | 1305 | path = models.FilePathField(max_length=255, blank=True) |
1306 | size = models.IntegerField() | 1306 | size = models.IntegerField() |
1307 | 1307 | ||
@@ -1318,7 +1318,7 @@ class Recipe(models.Model): | |||
1318 | 1318 | ||
1319 | name = models.CharField(max_length=100, blank=True) | 1319 | name = models.CharField(max_length=100, blank=True) |
1320 | version = models.CharField(max_length=100, blank=True) | 1320 | version = models.CharField(max_length=100, blank=True) |
1321 | layer_version = models.ForeignKey('Layer_Version', | 1321 | layer_version = models.ForeignKey('Layer_Version', on_delete=models.CASCADE, |
1322 | related_name='recipe_layer_version') | 1322 | related_name='recipe_layer_version') |
1323 | summary = models.TextField(blank=True) | 1323 | summary = models.TextField(blank=True) |
1324 | description = models.TextField(blank=True) | 1324 | description = models.TextField(blank=True) |
@@ -1356,7 +1356,7 @@ class Recipe_DependencyManager(models.Manager): | |||
1356 | 1356 | ||
1357 | class Provides(models.Model): | 1357 | class Provides(models.Model): |
1358 | name = models.CharField(max_length=100) | 1358 | name = models.CharField(max_length=100) |
1359 | recipe = models.ForeignKey(Recipe) | 1359 | recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE) |
1360 | 1360 | ||
1361 | class Recipe_Dependency(models.Model): | 1361 | class Recipe_Dependency(models.Model): |
1362 | TYPE_DEPENDS = 0 | 1362 | TYPE_DEPENDS = 0 |
@@ -1366,9 +1366,9 @@ class Recipe_Dependency(models.Model): | |||
1366 | (TYPE_DEPENDS, "depends"), | 1366 | (TYPE_DEPENDS, "depends"), |
1367 | (TYPE_RDEPENDS, "rdepends"), | 1367 | (TYPE_RDEPENDS, "rdepends"), |
1368 | ) | 1368 | ) |
1369 | recipe = models.ForeignKey(Recipe, related_name='r_dependencies_recipe') | 1369 | recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE, related_name='r_dependencies_recipe') |
1370 | depends_on = models.ForeignKey(Recipe, related_name='r_dependencies_depends') | 1370 | depends_on = models.ForeignKey(Recipe, on_delete=models.CASCADE, related_name='r_dependencies_depends') |
1371 | via = models.ForeignKey(Provides, null=True, default=None) | 1371 | via = models.ForeignKey(Provides, on_delete=models.CASCADE, null=True, default=None) |
1372 | dep_type = models.IntegerField(choices=DEPENDS_TYPE) | 1372 | dep_type = models.IntegerField(choices=DEPENDS_TYPE) |
1373 | objects = Recipe_DependencyManager() | 1373 | objects = Recipe_DependencyManager() |
1374 | 1374 | ||
@@ -1377,7 +1377,7 @@ class Machine(models.Model): | |||
1377 | search_allowed_fields = ["name", "description", "layer_version__layer__name"] | 1377 | search_allowed_fields = ["name", "description", "layer_version__layer__name"] |
1378 | up_date = models.DateTimeField(null = True, default = None) | 1378 | up_date = models.DateTimeField(null = True, default = None) |
1379 | 1379 | ||
1380 | layer_version = models.ForeignKey('Layer_Version') | 1380 | layer_version = models.ForeignKey('Layer_Version', on_delete=models.CASCADE) |
1381 | name = models.CharField(max_length=255) | 1381 | name = models.CharField(max_length=255) |
1382 | description = models.CharField(max_length=255) | 1382 | description = models.CharField(max_length=255) |
1383 | 1383 | ||
@@ -1408,7 +1408,7 @@ class Release(models.Model): | |||
1408 | """ A release is a project template, used to pre-populate Project settings with a configuration set """ | 1408 | """ A release is a project template, used to pre-populate Project settings with a configuration set """ |
1409 | name = models.CharField(max_length=32, unique = True) | 1409 | name = models.CharField(max_length=32, unique = True) |
1410 | description = models.CharField(max_length=255) | 1410 | description = models.CharField(max_length=255) |
1411 | bitbake_version = models.ForeignKey(BitbakeVersion) | 1411 | bitbake_version = models.ForeignKey(BitbakeVersion, on_delete=models.CASCADE) |
1412 | branch_name = models.CharField(max_length=50, default = "") | 1412 | branch_name = models.CharField(max_length=50, default = "") |
1413 | helptext = models.TextField(null=True) | 1413 | helptext = models.TextField(null=True) |
1414 | 1414 | ||
@@ -1419,7 +1419,7 @@ class Release(models.Model): | |||
1419 | return self.name | 1419 | return self.name |
1420 | 1420 | ||
1421 | class ReleaseDefaultLayer(models.Model): | 1421 | class ReleaseDefaultLayer(models.Model): |
1422 | release = models.ForeignKey(Release) | 1422 | release = models.ForeignKey(Release, on_delete=models.CASCADE) |
1423 | layer_name = models.CharField(max_length=100, default="") | 1423 | layer_name = models.CharField(max_length=100, default="") |
1424 | 1424 | ||
1425 | 1425 | ||
@@ -1474,10 +1474,10 @@ class Layer_Version(models.Model): | |||
1474 | "layer__description", "layer__vcs_url", | 1474 | "layer__description", "layer__vcs_url", |
1475 | "dirpath", "release__name", "commit", "branch"] | 1475 | "dirpath", "release__name", "commit", "branch"] |
1476 | 1476 | ||
1477 | build = models.ForeignKey(Build, related_name='layer_version_build', | 1477 | build = models.ForeignKey(Build, on_delete=models.CASCADE, related_name='layer_version_build', |
1478 | default=None, null=True) | 1478 | default=None, null=True) |
1479 | 1479 | ||
1480 | layer = models.ForeignKey(Layer, related_name='layer_version_layer') | 1480 | layer = models.ForeignKey(Layer, on_delete=models.CASCADE, related_name='layer_version_layer') |
1481 | 1481 | ||
1482 | layer_source = models.IntegerField(choices=LayerSource.SOURCE_TYPE, | 1482 | layer_source = models.IntegerField(choices=LayerSource.SOURCE_TYPE, |
1483 | default=0) | 1483 | default=0) |
@@ -1485,7 +1485,7 @@ class Layer_Version(models.Model): | |||
1485 | up_date = models.DateTimeField(null=True, default=timezone.now) | 1485 | up_date = models.DateTimeField(null=True, default=timezone.now) |
1486 | 1486 | ||
1487 | # To which metadata release does this layer version belong to | 1487 | # To which metadata release does this layer version belong to |
1488 | release = models.ForeignKey(Release, null=True, default=None) | 1488 | release = models.ForeignKey(Release, on_delete=models.CASCADE, null=True, default=None) |
1489 | 1489 | ||
1490 | branch = models.CharField(max_length=80) | 1490 | branch = models.CharField(max_length=80) |
1491 | commit = models.CharField(max_length=100) | 1491 | commit = models.CharField(max_length=100) |
@@ -1499,7 +1499,7 @@ class Layer_Version(models.Model): | |||
1499 | local_path = models.FilePathField(max_length=1024, default="/") | 1499 | local_path = models.FilePathField(max_length=1024, default="/") |
1500 | 1500 | ||
1501 | # Set if this layer is restricted to a particular project | 1501 | # Set if this layer is restricted to a particular project |
1502 | project = models.ForeignKey('Project', null=True, default=None) | 1502 | project = models.ForeignKey('Project', on_delete=models.CASCADE, null=True, default=None) |
1503 | 1503 | ||
1504 | # code lifted, with adaptations, from the layerindex-web application | 1504 | # code lifted, with adaptations, from the layerindex-web application |
1505 | # https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ | 1505 | # https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ |
@@ -1608,14 +1608,14 @@ class Layer_Version(models.Model): | |||
1608 | 1608 | ||
1609 | class LayerVersionDependency(models.Model): | 1609 | class LayerVersionDependency(models.Model): |
1610 | 1610 | ||
1611 | layer_version = models.ForeignKey(Layer_Version, | 1611 | layer_version = models.ForeignKey(Layer_Version, on_delete=models.CASCADE, |
1612 | related_name="dependencies") | 1612 | related_name="dependencies") |
1613 | depends_on = models.ForeignKey(Layer_Version, | 1613 | depends_on = models.ForeignKey(Layer_Version, on_delete=models.CASCADE, |
1614 | related_name="dependees") | 1614 | related_name="dependees") |
1615 | 1615 | ||
1616 | class ProjectLayer(models.Model): | 1616 | class ProjectLayer(models.Model): |
1617 | project = models.ForeignKey(Project) | 1617 | project = models.ForeignKey(Project, on_delete=models.CASCADE) |
1618 | layercommit = models.ForeignKey(Layer_Version, null=True) | 1618 | layercommit = models.ForeignKey(Layer_Version, on_delete=models.CASCADE, null=True) |
1619 | optional = models.BooleanField(default = True) | 1619 | optional = models.BooleanField(default = True) |
1620 | 1620 | ||
1621 | def __unicode__(self): | 1621 | def __unicode__(self): |
@@ -1630,8 +1630,8 @@ class CustomImageRecipe(Recipe): | |||
1630 | LAYER_NAME = "toaster-custom-images" | 1630 | LAYER_NAME = "toaster-custom-images" |
1631 | 1631 | ||
1632 | search_allowed_fields = ['name'] | 1632 | search_allowed_fields = ['name'] |
1633 | base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe') | 1633 | base_recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE, related_name='based_on_recipe') |
1634 | project = models.ForeignKey(Project) | 1634 | project = models.ForeignKey(Project, on_delete=models.CASCADE) |
1635 | last_updated = models.DateTimeField(null=True, default=None) | 1635 | last_updated = models.DateTimeField(null=True, default=None) |
1636 | 1636 | ||
1637 | def get_last_successful_built_target(self): | 1637 | def get_last_successful_built_target(self): |
@@ -1784,14 +1784,14 @@ class CustomImageRecipe(Recipe): | |||
1784 | return recipe_contents | 1784 | return recipe_contents |
1785 | 1785 | ||
1786 | class ProjectVariable(models.Model): | 1786 | class ProjectVariable(models.Model): |
1787 | project = models.ForeignKey(Project) | 1787 | project = models.ForeignKey(Project, on_delete=models.CASCADE) |
1788 | name = models.CharField(max_length=100) | 1788 | name = models.CharField(max_length=100) |
1789 | value = models.TextField(blank = True) | 1789 | value = models.TextField(blank = True) |
1790 | 1790 | ||
1791 | class Variable(models.Model): | 1791 | class Variable(models.Model): |
1792 | search_allowed_fields = ['variable_name', 'variable_value', | 1792 | search_allowed_fields = ['variable_name', 'variable_value', |
1793 | 'vhistory__file_name', "description"] | 1793 | 'vhistory__file_name', "description"] |
1794 | build = models.ForeignKey(Build, related_name='variable_build') | 1794 | build = models.ForeignKey(Build, on_delete=models.CASCADE, related_name='variable_build') |
1795 | variable_name = models.CharField(max_length=100) | 1795 | variable_name = models.CharField(max_length=100) |
1796 | variable_value = models.TextField(blank=True) | 1796 | variable_value = models.TextField(blank=True) |
1797 | changed = models.BooleanField(default=False) | 1797 | changed = models.BooleanField(default=False) |
@@ -1799,7 +1799,7 @@ class Variable(models.Model): | |||
1799 | description = models.TextField(blank=True) | 1799 | description = models.TextField(blank=True) |
1800 | 1800 | ||
1801 | class VariableHistory(models.Model): | 1801 | class VariableHistory(models.Model): |
1802 | variable = models.ForeignKey(Variable, related_name='vhistory') | 1802 | variable = models.ForeignKey(Variable, on_delete=models.CASCADE, related_name='vhistory') |
1803 | value = models.TextField(blank=True) | 1803 | value = models.TextField(blank=True) |
1804 | file_name = models.FilePathField(max_length=255) | 1804 | file_name = models.FilePathField(max_length=255) |
1805 | line_number = models.IntegerField(null=True) | 1805 | line_number = models.IntegerField(null=True) |
@@ -1809,7 +1809,7 @@ class HelpText(models.Model): | |||
1809 | VARIABLE = 0 | 1809 | VARIABLE = 0 |
1810 | HELPTEXT_AREA = ((VARIABLE, 'variable'), ) | 1810 | HELPTEXT_AREA = ((VARIABLE, 'variable'), ) |
1811 | 1811 | ||
1812 | build = models.ForeignKey(Build, related_name='helptext_build') | 1812 | build = models.ForeignKey(Build, on_delete=models.CASCADE, related_name='helptext_build') |
1813 | area = models.IntegerField(choices=HELPTEXT_AREA) | 1813 | area = models.IntegerField(choices=HELPTEXT_AREA) |
1814 | key = models.CharField(max_length=100) | 1814 | key = models.CharField(max_length=100) |
1815 | text = models.TextField() | 1815 | text = models.TextField() |
@@ -1829,8 +1829,8 @@ class LogMessage(models.Model): | |||
1829 | (EXCEPTION, "toaster exception") | 1829 | (EXCEPTION, "toaster exception") |
1830 | ) | 1830 | ) |
1831 | 1831 | ||
1832 | build = models.ForeignKey(Build) | 1832 | build = models.ForeignKey(Build, on_delete=models.CASCADE) |
1833 | task = models.ForeignKey(Task, blank = True, null=True) | 1833 | task = models.ForeignKey(Task, on_delete=models.CASCADE, blank = True, null=True) |
1834 | level = models.IntegerField(choices=LOG_LEVEL, default=INFO) | 1834 | level = models.IntegerField(choices=LOG_LEVEL, default=INFO) |
1835 | message = models.TextField(blank=True, null=True) | 1835 | message = models.TextField(blank=True, null=True) |
1836 | pathname = models.FilePathField(max_length=255, blank=True) | 1836 | pathname = models.FilePathField(max_length=255, blank=True) |
@@ -1859,7 +1859,7 @@ class Distro(models.Model): | |||
1859 | search_allowed_fields = ["name", "description", "layer_version__layer__name"] | 1859 | search_allowed_fields = ["name", "description", "layer_version__layer__name"] |
1860 | up_date = models.DateTimeField(null = True, default = None) | 1860 | up_date = models.DateTimeField(null = True, default = None) |
1861 | 1861 | ||
1862 | layer_version = models.ForeignKey('Layer_Version') | 1862 | layer_version = models.ForeignKey('Layer_Version', on_delete=models.CASCADE) |
1863 | name = models.CharField(max_length=255) | 1863 | name = models.CharField(max_length=255) |
1864 | description = models.CharField(max_length=255) | 1864 | description = models.CharField(max_length=255) |
1865 | 1865 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py index fba627bd21..8423d3dab2 100644 --- a/bitbake/lib/toaster/tests/browser/test_all_builds_page.py +++ b/bitbake/lib/toaster/tests/browser/test_all_builds_page.py | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | import re | 10 | import re |
11 | 11 | ||
12 | from django.core.urlresolvers import reverse | 12 | from django.urls import reverse |
13 | from django.utils import timezone | 13 | from django.utils import timezone |
14 | from tests.browser.selenium_helpers import SeleniumTestCase | 14 | from tests.browser.selenium_helpers import SeleniumTestCase |
15 | 15 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_all_projects_page.py b/bitbake/lib/toaster/tests/browser/test_all_projects_page.py index afd2d3566e..15b03400f9 100644 --- a/bitbake/lib/toaster/tests/browser/test_all_projects_page.py +++ b/bitbake/lib/toaster/tests/browser/test_all_projects_page.py | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | import re | 10 | import re |
11 | 11 | ||
12 | from django.core.urlresolvers import reverse | 12 | from django.urls import reverse |
13 | from django.utils import timezone | 13 | from django.utils import timezone |
14 | from tests.browser.selenium_helpers import SeleniumTestCase | 14 | from tests.browser.selenium_helpers import SeleniumTestCase |
15 | 15 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py index d972aff1bd..efcd89b346 100644 --- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py +++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | 12 | ||
13 | from tests.browser.selenium_helpers import SeleniumTestCase | 13 | from tests.browser.selenium_helpers import SeleniumTestCase |
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py index e2623e8ad3..c6226d60eb 100644 --- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py +++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | 12 | ||
13 | from tests.browser.selenium_helpers import SeleniumTestCase | 13 | from tests.browser.selenium_helpers import SeleniumTestCase |
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py index c542d45f1e..9d85ba990c 100644 --- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py +++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version | 13 | from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version |
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py index 22acb470ac..7fdf75d0a8 100644 --- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py +++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version | 13 | from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version |
diff --git a/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py b/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py index e8b4295b86..e6163bb3b2 100644 --- a/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py +++ b/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py | |||
@@ -11,7 +11,7 @@ | |||
11 | Run the js unit tests | 11 | Run the js unit tests |
12 | """ | 12 | """ |
13 | 13 | ||
14 | from django.core.urlresolvers import reverse | 14 | from django.urls import reverse |
15 | from tests.browser.selenium_helpers import SeleniumTestCase | 15 | from tests.browser.selenium_helpers import SeleniumTestCase |
16 | import logging | 16 | import logging |
17 | 17 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_landing_page.py b/bitbake/lib/toaster/tests/browser/test_landing_page.py index 07901989d5..8bb64b9f3e 100644 --- a/bitbake/lib/toaster/tests/browser/test_landing_page.py +++ b/bitbake/lib/toaster/tests/browser/test_landing_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # Copyright (C) 2013-2016 Intel Corporation | 7 | # Copyright (C) 2013-2016 Intel Corporation |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | 13 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py index f81e696a26..71bdd2aafd 100644 --- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py +++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # Copyright (C) 2013-2016 Intel Corporation | 7 | # Copyright (C) 2013-2016 Intel Corporation |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from tests.browser.selenium_helpers import SeleniumTestCase | 11 | from tests.browser.selenium_helpers import SeleniumTestCase |
12 | 12 | ||
13 | from orm.models import Layer, Layer_Version, Project, LayerSource, Release | 13 | from orm.models import Layer, Layer_Version, Project, LayerSource, Release |
diff --git a/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py b/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py index 15d25dc3a9..7844aaa395 100644 --- a/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py +++ b/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # Copyright (C) 2013-2016 Intel Corporation | 7 | # Copyright (C) 2013-2016 Intel Corporation |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | from tests.browser.selenium_helpers_base import Wait | 13 | from tests.browser.selenium_helpers_base import Wait |
diff --git a/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py b/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py index 0aa3b7a774..9906ae42a9 100644 --- a/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py +++ b/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from tests.browser.selenium_helpers import SeleniumTestCase | 11 | from tests.browser.selenium_helpers import SeleniumTestCase |
12 | 12 | ||
13 | from orm.models import BitbakeVersion, Release, Project, ProjectLayer, Layer | 13 | from orm.models import BitbakeVersion, Release, Project, ProjectLayer, Layer |
diff --git a/bitbake/lib/toaster/tests/browser/test_new_project_page.py b/bitbake/lib/toaster/tests/browser/test_new_project_page.py index 8e56bb043e..e20a1f686e 100644 --- a/bitbake/lib/toaster/tests/browser/test_new_project_page.py +++ b/bitbake/lib/toaster/tests/browser/test_new_project_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from tests.browser.selenium_helpers import SeleniumTestCase | 11 | from tests.browser.selenium_helpers import SeleniumTestCase |
12 | from selenium.webdriver.support.ui import Select | 12 | from selenium.webdriver.support.ui import Select |
13 | from selenium.common.exceptions import InvalidElementStateException | 13 | from selenium.common.exceptions import InvalidElementStateException |
diff --git a/bitbake/lib/toaster/tests/browser/test_project_builds_page.py b/bitbake/lib/toaster/tests/browser/test_project_builds_page.py index 47fb10b262..51717e72d4 100644 --- a/bitbake/lib/toaster/tests/browser/test_project_builds_page.py +++ b/bitbake/lib/toaster/tests/browser/test_project_builds_page.py | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | import re | 10 | import re |
11 | 11 | ||
12 | from django.core.urlresolvers import reverse | 12 | from django.urls import reverse |
13 | from django.utils import timezone | 13 | from django.utils import timezone |
14 | from tests.browser.selenium_helpers import SeleniumTestCase | 14 | from tests.browser.selenium_helpers import SeleniumTestCase |
15 | 15 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_project_config_page.py b/bitbake/lib/toaster/tests/browser/test_project_config_page.py index eaf27a1e78..944bcb2631 100644 --- a/bitbake/lib/toaster/tests/browser/test_project_config_page.py +++ b/bitbake/lib/toaster/tests/browser/test_project_config_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from tests.browser.selenium_helpers import SeleniumTestCase | 11 | from tests.browser.selenium_helpers import SeleniumTestCase |
12 | 12 | ||
13 | from orm.models import BitbakeVersion, Release, Project, ProjectVariable | 13 | from orm.models import BitbakeVersion, Release, Project, ProjectVariable |
@@ -213,4 +213,5 @@ class TestProjectConfigsPage(SeleniumTestCase): | |||
213 | 213 | ||
214 | hidden_element = self.driver.find_element_by_id('hintError-sstate_dir') | 214 | hidden_element = self.driver.find_element_by_id('hintError-sstate_dir') |
215 | self.assertEqual(hidden_element.is_displayed(), False, | 215 | self.assertEqual(hidden_element.is_displayed(), False, |
216 | 'sstate directory path valid but treated as invalid') \ No newline at end of file | 216 | 'sstate directory path valid but treated as invalid') |
217 | |||
diff --git a/bitbake/lib/toaster/tests/browser/test_project_page.py b/bitbake/lib/toaster/tests/browser/test_project_page.py index 8b5e1b6739..546293f1ee 100644 --- a/bitbake/lib/toaster/tests/browser/test_project_page.py +++ b/bitbake/lib/toaster/tests/browser/test_project_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | 13 | ||
diff --git a/bitbake/lib/toaster/tests/browser/test_sample.py b/bitbake/lib/toaster/tests/browser/test_sample.py index f4ad670a36..b0067c21cd 100644 --- a/bitbake/lib/toaster/tests/browser/test_sample.py +++ b/bitbake/lib/toaster/tests/browser/test_sample.py | |||
@@ -16,7 +16,7 @@ New test files should follow this structure, should be named "test_*.py", | |||
16 | and should be in the same directory as this sample. | 16 | and should be in the same directory as this sample. |
17 | """ | 17 | """ |
18 | 18 | ||
19 | from django.core.urlresolvers import reverse | 19 | from django.urls import reverse |
20 | from tests.browser.selenium_helpers import SeleniumTestCase | 20 | from tests.browser.selenium_helpers import SeleniumTestCase |
21 | 21 | ||
22 | class TestSample(SeleniumTestCase): | 22 | class TestSample(SeleniumTestCase): |
diff --git a/bitbake/lib/toaster/tests/browser/test_task_page.py b/bitbake/lib/toaster/tests/browser/test_task_page.py index 26f3dca83c..011b5854ae 100644 --- a/bitbake/lib/toaster/tests/browser/test_task_page.py +++ b/bitbake/lib/toaster/tests/browser/test_task_page.py | |||
@@ -7,7 +7,7 @@ | |||
7 | # SPDX-License-Identifier: GPL-2.0-only | 7 | # SPDX-License-Identifier: GPL-2.0-only |
8 | # | 8 | # |
9 | 9 | ||
10 | from django.core.urlresolvers import reverse | 10 | from django.urls import reverse |
11 | from django.utils import timezone | 11 | from django.utils import timezone |
12 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
13 | from orm.models import Project, Build, Layer, Layer_Version, Recipe, Target | 13 | from orm.models import Project, Build, Layer, Layer_Version, Recipe, Target |
diff --git a/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py b/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py index ef78cbb1ee..e82d5ec654 100644 --- a/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py +++ b/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | from datetime import datetime | 10 | from datetime import datetime |
11 | 11 | ||
12 | from django.core.urlresolvers import reverse | 12 | from django.urls import reverse |
13 | from django.utils import timezone | 13 | from django.utils import timezone |
14 | from tests.browser.selenium_helpers import SeleniumTestCase | 14 | from tests.browser.selenium_helpers import SeleniumTestCase |
15 | from orm.models import BitbakeVersion, Release, Project, Build | 15 | from orm.models import BitbakeVersion, Release, Project, Build |
diff --git a/bitbake/lib/toaster/tests/views/test_views.py b/bitbake/lib/toaster/tests/views/test_views.py index 68d9e9de14..735d596bcc 100644 --- a/bitbake/lib/toaster/tests/views/test_views.py +++ b/bitbake/lib/toaster/tests/views/test_views.py | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | from django.test import TestCase | 12 | from django.test import TestCase |
13 | from django.test.client import RequestFactory | 13 | from django.test.client import RequestFactory |
14 | from django.core.urlresolvers import reverse | 14 | from django.urls import reverse |
15 | from django.db.models import Q | 15 | from django.db.models import Q |
16 | 16 | ||
17 | from orm.models import Project, Package | 17 | from orm.models import Project, Package |
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 |
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py index 3e246fda83..7718caa57a 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py +++ b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py | |||
@@ -466,7 +466,6 @@ class Command(BaseCommand): | |||
466 | release_name = 'None' if not pl.layercommit.release else pl.layercommit.release.name | 466 | release_name = 'None' if not pl.layercommit.release else pl.layercommit.release.name |
467 | print(" AFTER :ProjectLayer=%s,%s,%s,%s" % (pl.layercommit.layer.name,release_name,pl.layercommit.branch,pl.layercommit.commit)) | 467 | print(" AFTER :ProjectLayer=%s,%s,%s,%s" % (pl.layercommit.layer.name,release_name,pl.layercommit.branch,pl.layercommit.commit)) |
468 | 468 | ||
469 | |||
470 | def handle(self, *args, **options): | 469 | def handle(self, *args, **options): |
471 | project_name = options['name'] | 470 | project_name = options['name'] |
472 | project_path = options['path'] | 471 | project_path = options['path'] |
@@ -551,6 +550,7 @@ class Command(BaseCommand): | |||
551 | # preset the mode and default image recipe | 550 | # preset the mode and default image recipe |
552 | project.set_variable(Project.PROJECT_SPECIFIC_ISNEW,Project.PROJECT_SPECIFIC_NEW) | 551 | project.set_variable(Project.PROJECT_SPECIFIC_ISNEW,Project.PROJECT_SPECIFIC_NEW) |
553 | project.set_variable(Project.PROJECT_SPECIFIC_DEFAULTIMAGE,"core-image-minimal") | 552 | project.set_variable(Project.PROJECT_SPECIFIC_DEFAULTIMAGE,"core-image-minimal") |
553 | |||
554 | # Assert any extended/custom actions or variables for new non-Toaster projects | 554 | # Assert any extended/custom actions or variables for new non-Toaster projects |
555 | if not len(self.toaster_vars): | 555 | if not len(self.toaster_vars): |
556 | pass | 556 | pass |
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 74501fa26b..a4b370c8d4 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
@@ -189,15 +189,16 @@ TEMPLATES = [ | |||
189 | }, | 189 | }, |
190 | ] | 190 | ] |
191 | 191 | ||
192 | MIDDLEWARE_CLASSES = ( | 192 | MIDDLEWARE = [ |
193 | 'django.middleware.common.CommonMiddleware', | 193 | 'django.middleware.common.CommonMiddleware', |
194 | 'django.contrib.sessions.middleware.SessionMiddleware', | 194 | 'django.contrib.sessions.middleware.SessionMiddleware', |
195 | 'django.middleware.csrf.CsrfViewMiddleware', | 195 | 'django.middleware.csrf.CsrfViewMiddleware', |
196 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | 196 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
197 | 'django.contrib.messages.middleware.MessageMiddleware', | 197 | 'django.contrib.messages.middleware.MessageMiddleware', |
198 | # Uncomment the next line for simple clickjacking protection: | 198 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
199 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', | 199 | 'django.contrib.messages.middleware.MessageMiddleware', |
200 | ) | 200 | 'django.contrib.sessions.middleware.SessionMiddleware', |
201 | ] | ||
201 | 202 | ||
202 | CACHES = { | 203 | CACHES = { |
203 | # 'default': { | 204 | # 'default': { |
@@ -248,7 +249,7 @@ FRESH_ENABLED = False | |||
248 | if os.environ.get('TOASTER_DEVEL', None) is not None: | 249 | if os.environ.get('TOASTER_DEVEL', None) is not None: |
249 | try: | 250 | try: |
250 | import fresh | 251 | import fresh |
251 | MIDDLEWARE_CLASSES = ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES | 252 | MIDDLEWARE = ["fresh.middleware.FreshMiddleware",] + MIDDLEWARE |
252 | INSTALLED_APPS = INSTALLED_APPS + ('fresh',) | 253 | INSTALLED_APPS = INSTALLED_APPS + ('fresh',) |
253 | FRESH_ENABLED = True | 254 | FRESH_ENABLED = True |
254 | except: | 255 | except: |
@@ -258,8 +259,8 @@ DEBUG_PANEL_ENABLED = False | |||
258 | if os.environ.get('TOASTER_DEVEL', None) is not None: | 259 | if os.environ.get('TOASTER_DEVEL', None) is not None: |
259 | try: | 260 | try: |
260 | import debug_toolbar, debug_panel | 261 | import debug_toolbar, debug_panel |
261 | MIDDLEWARE_CLASSES = ('debug_panel.middleware.DebugPanelMiddleware',) + MIDDLEWARE_CLASSES | 262 | MIDDLEWARE = ['debug_panel.middleware.DebugPanelMiddleware',] + MIDDLEWARE |
262 | #MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',) | 263 | #MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware',] |
263 | INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',) | 264 | INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',) |
264 | DEBUG_PANEL_ENABLED = True | 265 | DEBUG_PANEL_ENABLED = True |
265 | 266 | ||
@@ -352,5 +353,3 @@ def activate_synchronous_off(sender, connection, **kwargs): | |||
352 | connection_created.connect(activate_synchronous_off) | 353 | connection_created.connect(activate_synchronous_off) |
353 | # | 354 | # |
354 | 355 | ||
355 | |||
356 | |||
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index ac77bc3632..5fb520b384 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
@@ -51,7 +51,7 @@ if toastermain.settings.DEBUG_PANEL_ENABLED: | |||
51 | 51 | ||
52 | urlpatterns = [ | 52 | urlpatterns = [ |
53 | # Uncomment the next line to enable the admin: | 53 | # Uncomment the next line to enable the admin: |
54 | url(r'^admin/', include(admin.site.urls)), | 54 | url(r'^admin/', admin.site.urls), |
55 | ] + urlpatterns | 55 | ] + urlpatterns |
56 | 56 | ||
57 | # Automatically discover urls.py in various apps, beside our own | 57 | # Automatically discover urls.py in various apps, beside our own |
@@ -69,7 +69,7 @@ for t in os.walk(os.path.dirname(currentdir)): | |||
69 | # make sure we don't have this module name in | 69 | # make sure we don't have this module name in |
70 | conflict = False | 70 | conflict = False |
71 | for p in urlpatterns: | 71 | for p in urlpatterns: |
72 | if p.regex.pattern == '^' + modulename + '/': | 72 | if p.pattern.regex.pattern == '^' + modulename + '/': |
73 | conflict = True | 73 | conflict = True |
74 | if not conflict: | 74 | if not conflict: |
75 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) | 75 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) |