summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-07-15 13:01:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-23 20:06:57 +0100
commit5aba3d7fcc3a9edf477bedeced96444b2fbcb8be (patch)
treef273adece5de31e95cc6f6e24b216706ed43c859 /bitbake/lib
parent6cfb76fa8bd1c192e6a0524b7670e2172e5d8e26 (diff)
downloadpoky-5aba3d7fcc3a9edf477bedeced96444b2fbcb8be.tar.gz
bitbake: toaster: improved Project models
A layer may live in a subdirectory of a git repository, so we add a field to track this setting in the Project layers. We add the Project schedule_build function, which creates a build request from the current project configuration. We also fix an import problem with Projects in views. (Bitbake rev: 1b5835e5d48cbfb7d38e38437c45d161052dfb37) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/bldcontrol/migrations/0003_auto__add_field_brlayer_dirpath.py99
-rw-r--r--bitbake/lib/toaster/bldcontrol/models.py2
-rw-r--r--bitbake/lib/toaster/orm/migrations/0011_auto__add_field_projectlayer_dirpath.py242
-rw-r--r--bitbake/lib/toaster/orm/models.py21
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py2
5 files changed, 364 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/migrations/0003_auto__add_field_brlayer_dirpath.py b/bitbake/lib/toaster/bldcontrol/migrations/0003_auto__add_field_brlayer_dirpath.py
new file mode 100644
index 0000000000..b9ba838d90
--- /dev/null
+++ b/bitbake/lib/toaster/bldcontrol/migrations/0003_auto__add_field_brlayer_dirpath.py
@@ -0,0 +1,99 @@
1# -*- coding: utf-8 -*-
2from south.utils import datetime_utils as datetime
3from south.db import db
4from south.v2 import SchemaMigration
5from django.db import models
6
7
8class Migration(SchemaMigration):
9
10 def forwards(self, orm):
11 # Adding field 'BRLayer.dirpath'
12 db.add_column(u'bldcontrol_brlayer', 'dirpath',
13 self.gf('django.db.models.fields.CharField')(default='', max_length=254),
14 keep_default=False)
15
16
17 def backwards(self, orm):
18 # Deleting field 'BRLayer.dirpath'
19 db.delete_column(u'bldcontrol_brlayer', 'dirpath')
20
21
22 models = {
23 u'bldcontrol.brlayer': {
24 'Meta': {'object_name': 'BRLayer'},
25 'commit': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
26 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
27 'giturl': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
28 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
29 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
30 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"})
31 },
32 u'bldcontrol.brtarget': {
33 'Meta': {'object_name': 'BRTarget'},
34 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
35 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}),
36 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
37 'task': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
38 },
39 u'bldcontrol.brvariable': {
40 'Meta': {'object_name': 'BRVariable'},
41 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
43 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}),
44 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
45 },
46 u'bldcontrol.buildenvironment': {
47 'Meta': {'object_name': 'BuildEnvironment'},
48 'address': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
49 'bbaddress': ('django.db.models.fields.CharField', [], {'max_length': '254', 'blank': 'True'}),
50 'bbport': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
51 'bbstate': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
52 'bbtoken': ('django.db.models.fields.CharField', [], {'max_length': '126', 'blank': 'True'}),
53 'betype': ('django.db.models.fields.IntegerField', [], {}),
54 'builddir': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
55 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
56 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
57 'lock': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
58 'sourcedir': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
59 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
60 },
61 u'bldcontrol.buildrequest': {
62 'Meta': {'object_name': 'BuildRequest'},
63 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']", 'null': 'True'}),
64 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
65 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
66 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}),
67 'state': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
68 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
69 },
70 u'orm.build': {
71 'Meta': {'object_name': 'Build'},
72 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
73 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
74 'completed_on': ('django.db.models.fields.DateTimeField', [], {}),
75 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
76 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
77 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
78 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
79 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
80 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
81 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
82 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']", 'null': 'True'}),
83 'started_on': ('django.db.models.fields.DateTimeField', [], {}),
84 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
85 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'})
86 },
87 u'orm.project': {
88 'Meta': {'object_name': 'Project'},
89 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
90 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
91 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
93 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
94 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
95 'user_id': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
96 }
97 }
98
99 complete_apps = ['bldcontrol'] \ No newline at end of file
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py
index 8285257c8e..1f253ffb22 100644
--- a/bitbake/lib/toaster/bldcontrol/models.py
+++ b/bitbake/lib/toaster/bldcontrol/models.py
@@ -71,6 +71,8 @@ class BRLayer(models.Model):
71 name = models.CharField(max_length = 100) 71 name = models.CharField(max_length = 100)
72 giturl = models.CharField(max_length = 254) 72 giturl = models.CharField(max_length = 254)
73 commit = models.CharField(max_length = 254) 73 commit = models.CharField(max_length = 254)
74 dirpath = models.CharField(max_length = 254)
75
74 76
75class BRVariable(models.Model): 77class BRVariable(models.Model):
76 req = models.ForeignKey(BuildRequest) 78 req = models.ForeignKey(BuildRequest)
diff --git a/bitbake/lib/toaster/orm/migrations/0011_auto__add_field_projectlayer_dirpath.py b/bitbake/lib/toaster/orm/migrations/0011_auto__add_field_projectlayer_dirpath.py
new file mode 100644
index 0000000000..8a65221594
--- /dev/null
+++ b/bitbake/lib/toaster/orm/migrations/0011_auto__add_field_projectlayer_dirpath.py
@@ -0,0 +1,242 @@
1# -*- coding: utf-8 -*-
2from south.utils import datetime_utils as datetime
3from south.db import db
4from south.v2 import SchemaMigration
5from django.db import models
6
7
8class Migration(SchemaMigration):
9
10 def forwards(self, orm):
11 # Adding field 'ProjectLayer.dirpath'
12 db.add_column(u'orm_projectlayer', 'dirpath',
13 self.gf('django.db.models.fields.CharField')(default='', max_length=254),
14 keep_default=False)
15
16
17 def backwards(self, orm):
18 # Deleting field 'ProjectLayer.dirpath'
19 db.delete_column(u'orm_projectlayer', 'dirpath')
20
21
22 models = {
23 u'orm.build': {
24 'Meta': {'object_name': 'Build'},
25 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
26 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
27 'completed_on': ('django.db.models.fields.DateTimeField', [], {}),
28 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
29 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
30 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
31 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
32 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
33 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
34 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
35 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']", 'null': 'True'}),
36 'started_on': ('django.db.models.fields.DateTimeField', [], {}),
37 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
38 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'})
39 },
40 u'orm.helptext': {
41 'Meta': {'object_name': 'HelpText'},
42 'area': ('django.db.models.fields.IntegerField', [], {}),
43 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'helptext_build'", 'to': u"orm['orm.Build']"}),
44 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45 'key': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
46 'text': ('django.db.models.fields.TextField', [], {})
47 },
48 u'orm.layer': {
49 'Meta': {'object_name': 'Layer'},
50 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
51 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
52 'local_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
53 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
54 },
55 u'orm.layer_version': {
56 'Meta': {'object_name': 'Layer_Version'},
57 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
58 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_build'", 'to': u"orm['orm.Build']"}),
59 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
60 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}),
62 'priority': ('django.db.models.fields.IntegerField', [], {})
63 },
64 u'orm.logmessage': {
65 'Meta': {'object_name': 'LogMessage'},
66 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
67 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
68 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
69 'lineno': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
70 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
71 'pathname': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
72 'task': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Task']", 'null': 'True', 'blank': 'True'})
73 },
74 u'orm.package': {
75 'Meta': {'object_name': 'Package'},
76 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
77 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
78 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
79 'installed_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}),
80 'installed_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
81 'license': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
82 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
83 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Recipe']", 'null': 'True'}),
84 'revision': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
85 'section': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
86 'size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
87 'summary': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
88 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
89 },
90 u'orm.package_dependency': {
91 'Meta': {'object_name': 'Package_Dependency'},
92 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
93 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_target'", 'to': u"orm['orm.Package']"}),
94 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
95 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_source'", 'to': u"orm['orm.Package']"}),
96 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']", 'null': 'True'})
97 },
98 u'orm.package_file': {
99 'Meta': {'object_name': 'Package_File'},
100 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
101 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildfilelist_package'", 'to': u"orm['orm.Package']"}),
102 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
103 'size': ('django.db.models.fields.IntegerField', [], {})
104 },
105 u'orm.project': {
106 'Meta': {'object_name': 'Project'},
107 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
108 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
109 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
110 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
111 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
112 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
113 'user_id': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
114 },
115 u'orm.projectlayer': {
116 'Meta': {'object_name': 'ProjectLayer'},
117 'commit': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
118 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
119 'giturl': ('django.db.models.fields.CharField', [], {'max_length': '254'}),
120 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
121 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
122 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"})
123 },
124 u'orm.projecttarget': {
125 'Meta': {'object_name': 'ProjectTarget'},
126 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
127 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}),
128 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'})
129 },
130 u'orm.projectvariable': {
131 'Meta': {'object_name': 'ProjectVariable'},
132 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
133 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
134 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}),
135 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
136 },
137 u'orm.recipe': {
138 'Meta': {'object_name': 'Recipe'},
139 'bugtracker': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
140 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
141 'file_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
142 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
143 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
144 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recipe_layer_version'", 'to': u"orm['orm.Layer_Version']"}),
145 'license': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
146 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
147 'section': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
148 'summary': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
149 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
150 },
151 u'orm.recipe_dependency': {
152 'Meta': {'object_name': 'Recipe_Dependency'},
153 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
154 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_depends'", 'to': u"orm['orm.Recipe']"}),
155 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
156 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_recipe'", 'to': u"orm['orm.Recipe']"})
157 },
158 u'orm.target': {
159 'Meta': {'object_name': 'Target'},
160 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
161 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
162 'image_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
163 'is_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
164 'license_manifest_path': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}),
165 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'})
166 },
167 u'orm.target_file': {
168 'Meta': {'object_name': 'Target_File'},
169 'directory': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'directory_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}),
170 'group': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
171 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
172 'inodetype': ('django.db.models.fields.IntegerField', [], {}),
173 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
174 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}),
175 'permission': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
176 'size': ('django.db.models.fields.IntegerField', [], {}),
177 'sym_target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'symlink_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}),
178 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
179 },
180 u'orm.target_image_file': {
181 'Meta': {'object_name': 'Target_Image_File'},
182 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '254'}),
183 'file_size': ('django.db.models.fields.IntegerField', [], {}),
184 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
185 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
186 },
187 u'orm.target_installed_package': {
188 'Meta': {'object_name': 'Target_Installed_Package'},
189 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
190 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildtargetlist_package'", 'to': u"orm['orm.Package']"}),
191 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
192 },
193 u'orm.task': {
194 'Meta': {'ordering': "('order', 'recipe')", 'unique_together': "(('build', 'recipe', 'task_name'),)", 'object_name': 'Task'},
195 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_build'", 'to': u"orm['orm.Build']"}),
196 'cpu_usage': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
197 'disk_io': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
198 'elapsed_time': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
199 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
200 'line_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
201 'logfile': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
202 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
203 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
204 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
205 'path_to_sstate_obj': ('django.db.models.fields.FilePathField', [], {'max_length': '500', 'blank': 'True'}),
206 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'build_recipe'", 'to': u"orm['orm.Recipe']"}),
207 'script_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
208 'source_url': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
209 'sstate_checksum': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
210 'sstate_result': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
211 'task_executed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
212 'task_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
213 'work_directory': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'})
214 },
215 u'orm.task_dependency': {
216 'Meta': {'object_name': 'Task_Dependency'},
217 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_depends'", 'to': u"orm['orm.Task']"}),
218 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
219 'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_task'", 'to': u"orm['orm.Task']"})
220 },
221 u'orm.variable': {
222 'Meta': {'object_name': 'Variable'},
223 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'variable_build'", 'to': u"orm['orm.Build']"}),
224 'changed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
225 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
226 'human_readable_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
227 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
228 'variable_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
229 'variable_value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
230 },
231 u'orm.variablehistory': {
232 'Meta': {'object_name': 'VariableHistory'},
233 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
234 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
235 'line_number': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
236 'operation': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
237 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
238 'variable': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vhistory'", 'to': u"orm['orm.Variable']"})
239 }
240 }
241
242 complete_apps = ['orm'] \ No newline at end of file
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index f4064296bc..9b7387a8af 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -37,13 +37,13 @@ class ProjectManager(models.Manager):
37 name = "meta", 37 name = "meta",
38 giturl = "git://git.yoctoproject.org/poky", 38 giturl = "git://git.yoctoproject.org/poky",
39 commit = branch, 39 commit = branch,
40 treepath = "meta") 40 dirpath = "meta")
41 41
42 ProjectLayer.objects.create(project = prj, 42 ProjectLayer.objects.create(project = prj,
43 name = "meta-yocto", 43 name = "meta-yocto",
44 giturl = "git://git.yoctoproject.org/poky", 44 giturl = "git://git.yoctoproject.org/poky",
45 commit = branch, 45 commit = branch,
46 treepath = "meta-yocto") 46 dirpath = "meta-yocto")
47 47
48 return prj 48 return prj
49 49
@@ -66,6 +66,22 @@ class Project(models.Model):
66 user_id = models.IntegerField(null = True) 66 user_id = models.IntegerField(null = True)
67 objects = ProjectManager() 67 objects = ProjectManager()
68 68
69
70 def schedule_build(self):
71 from bldcontrol.models import BuildRequest, BRTarget, BRLayer, BRVariable
72 br = BuildRequest.objects.create(project = self)
73 for l in self.projectlayer_set.all():
74 BRLayer.objects.create(req = br, name = l.name, giturl = l.giturl, commit = l.commit, dirpath = l.dirpath)
75 for t in self.projecttarget_set.all():
76 BRTarget.objects.create(req = br, target = t.target, task = t.task)
77 for v in self.projectvariable_set.all():
78 BRVariable.objects.create(req = br, name = v.name, value = v.value)
79
80 br.state = BuildRequest.REQ_QUEUED
81 br.save()
82 return br
83
84
69class Build(models.Model): 85class Build(models.Model):
70 SUCCEEDED = 0 86 SUCCEEDED = 0
71 FAILED = 1 87 FAILED = 1
@@ -375,6 +391,7 @@ class ProjectLayer(models.Model):
375 name = models.CharField(max_length = 100) 391 name = models.CharField(max_length = 100)
376 giturl = models.CharField(max_length = 254) 392 giturl = models.CharField(max_length = 254)
377 commit = models.CharField(max_length = 254) 393 commit = models.CharField(max_length = 254)
394 dirpath = models.CharField(max_length = 254)
378 395
379class Layer(models.Model): 396class Layer(models.Model):
380 name = models.CharField(max_length=100) 397 name = models.CharField(max_length=100)
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 8fbe8a3640..f9e8e51688 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1773,6 +1773,8 @@ if toastermain.settings.MANAGED:
1773 from django.contrib.auth import authenticate, login 1773 from django.contrib.auth import authenticate, login
1774 from django.contrib.auth.decorators import login_required 1774 from django.contrib.auth.decorators import login_required
1775 1775
1776 from orm.models import Project
1777
1776 import traceback 1778 import traceback
1777 1779
1778 class BadParameterException(Exception): pass # error thrown on invalid POST requests 1780 class BadParameterException(Exception): pass # error thrown on invalid POST requests