diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-10-09 12:37:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:39:51 +0000 |
commit | a0660718e6599538dd65cadadbc04c6adc951b57 (patch) | |
tree | 530aeb143dcd059ea74e075ae6df5bab9afd7823 /bitbake/lib/toaster/orm | |
parent | 97c0beb0eb127f05e70a9c3a7202b0cba16d7152 (diff) | |
download | poky-a0660718e6599538dd65cadadbc04c6adc951b57.tar.gz |
bitbake: toaster: improvements for admin pages
The default django URL validator marks git URLs as not valid,
so we change the default validators to a URLValidator-derived
that adds git and ssh protocol schemas and inhibits the
frontend URL validator.
We update the branch names based on the white-listed
branch names in the Releases name.
Adds proper class string to ease usage in admin section.
Other small improvements.
(Bitbake rev: 7d51f895bd56bd18f2258059b377851c2ce82114)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Conflicts:
bitbake/lib/toaster/orm/admin.py
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
3 files changed, 349 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/orm/admin.py b/bitbake/lib/toaster/orm/admin.py index 6739980bfc..706e517e0e 100644 --- a/bitbake/lib/toaster/orm/admin.py +++ b/bitbake/lib/toaster/orm/admin.py | |||
@@ -18,7 +18,7 @@ class BitbakeVersionAdmin(admin.ModelAdmin): | |||
18 | if isinstance(db_field, models.fields.URLField): | 18 | if isinstance(db_field, models.fields.URLField): |
19 | return forms.fields.CharField() | 19 | return forms.fields.CharField() |
20 | return super(BitbakeVersionAdmin, self).formfield_for_dbfield(db_field, **kwargs) | 20 | return super(BitbakeVersionAdmin, self).formfield_for_dbfield(db_field, **kwargs) |
21 | 21 | ||
22 | 22 | ||
23 | 23 | ||
24 | class ReleaseAdmin(admin.ModelAdmin): | 24 | class ReleaseAdmin(admin.ModelAdmin): |
diff --git a/bitbake/lib/toaster/orm/migrations/0014_auto__chg_field_package_summary__chg_field_layer_summary__chg_field_re.py b/bitbake/lib/toaster/orm/migrations/0014_auto__chg_field_package_summary__chg_field_layer_summary__chg_field_re.py new file mode 100644 index 0000000000..7945f15a17 --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0014_auto__chg_field_package_summary__chg_field_layer_summary__chg_field_re.py | |||
@@ -0,0 +1,336 @@ | |||
1 | # -*- coding: utf-8 -*- | ||
2 | from south.utils import datetime_utils as datetime | ||
3 | from south.db import db | ||
4 | from south.v2 import SchemaMigration | ||
5 | from django.db import models | ||
6 | |||
7 | |||
8 | class Migration(SchemaMigration): | ||
9 | |||
10 | def forwards(self, orm): | ||
11 | |||
12 | # Changing field 'Package.summary' | ||
13 | db.alter_column(u'orm_package', 'summary', self.gf('django.db.models.fields.TextField')()) | ||
14 | |||
15 | # Changing field 'Layer.summary' | ||
16 | db.alter_column(u'orm_layer', 'summary', self.gf('django.db.models.fields.TextField')(null=True)) | ||
17 | |||
18 | # Changing field 'Recipe.summary' | ||
19 | db.alter_column(u'orm_recipe', 'summary', self.gf('django.db.models.fields.TextField')()) | ||
20 | |||
21 | def backwards(self, orm): | ||
22 | |||
23 | # Changing field 'Package.summary' | ||
24 | db.alter_column(u'orm_package', 'summary', self.gf('django.db.models.fields.CharField')(max_length=200)) | ||
25 | |||
26 | # Changing field 'Layer.summary' | ||
27 | db.alter_column(u'orm_layer', 'summary', self.gf('django.db.models.fields.CharField')(max_length=200, null=True)) | ||
28 | |||
29 | # Changing field 'Recipe.summary' | ||
30 | db.alter_column(u'orm_recipe', 'summary', self.gf('django.db.models.fields.CharField')(max_length=100)) | ||
31 | |||
32 | models = { | ||
33 | u'orm.bitbakeversion': { | ||
34 | 'Meta': {'object_name': 'BitbakeVersion'}, | ||
35 | 'branch': ('django.db.models.fields.CharField', [], {'max_length': '32'}), | ||
36 | 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
37 | 'giturl': ('django.db.models.fields.URLField', [], {'max_length': '200'}), | ||
38 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
39 | 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}) | ||
40 | }, | ||
41 | u'orm.branch': { | ||
42 | 'Meta': {'unique_together': "(('layer_source', 'name'), ('layer_source', 'up_id'))", 'object_name': 'Branch'}, | ||
43 | 'bitbake_branch': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), | ||
44 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
45 | 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'True', 'to': u"orm['orm.LayerSource']", 'null': 'True'}), | ||
46 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | ||
47 | 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), | ||
48 | 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}), | ||
49 | 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}) | ||
50 | }, | ||
51 | u'orm.build': { | ||
52 | 'Meta': {'object_name': 'Build'}, | ||
53 | 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | ||
54 | 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
55 | 'completed_on': ('django.db.models.fields.DateTimeField', [], {}), | ||
56 | 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}), | ||
57 | 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
58 | 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
59 | 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
60 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
61 | 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
62 | 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}), | ||
63 | 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']", 'null': 'True'}), | ||
64 | 'started_on': ('django.db.models.fields.DateTimeField', [], {}), | ||
65 | 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
66 | 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}) | ||
67 | }, | ||
68 | u'orm.helptext': { | ||
69 | 'Meta': {'object_name': 'HelpText'}, | ||
70 | 'area': ('django.db.models.fields.IntegerField', [], {}), | ||
71 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'helptext_build'", 'to': u"orm['orm.Build']"}), | ||
72 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
73 | 'key': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
74 | 'text': ('django.db.models.fields.TextField', [], {}) | ||
75 | }, | ||
76 | u'orm.layer': { | ||
77 | 'Meta': {'unique_together': "(('layer_source', 'up_id'), ('layer_source', 'name'))", 'object_name': 'Layer'}, | ||
78 | 'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), | ||
79 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
80 | 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), | ||
81 | 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}), | ||
82 | 'local_path': ('django.db.models.fields.FilePathField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), | ||
83 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
84 | 'summary': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}), | ||
85 | 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}), | ||
86 | 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}), | ||
87 | 'vcs_url': ('django.db.models.fields.URLField', [], {'default': 'None', 'max_length': '200', 'null': 'True'}), | ||
88 | 'vcs_web_file_base_url': ('django.db.models.fields.URLField', [], {'default': 'None', 'max_length': '200', 'null': 'True'}) | ||
89 | }, | ||
90 | u'orm.layer_version': { | ||
91 | 'Meta': {'unique_together': "(('layer_source', 'up_id'),)", 'object_name': 'Layer_Version'}, | ||
92 | 'branch': ('django.db.models.fields.CharField', [], {'max_length': '80'}), | ||
93 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'layer_version_build'", 'null': 'True', 'to': u"orm['orm.Build']"}), | ||
94 | 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
95 | 'dirpath': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), | ||
96 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
97 | 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}), | ||
98 | 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}), | ||
99 | 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
100 | 'up_branch': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.Branch']", 'null': 'True'}), | ||
101 | 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}), | ||
102 | 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}) | ||
103 | }, | ||
104 | u'orm.layersource': { | ||
105 | 'Meta': {'unique_together': "(('sourcetype', 'apiurl'),)", 'object_name': 'LayerSource'}, | ||
106 | 'apiurl': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True'}), | ||
107 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
108 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '63'}), | ||
109 | 'sourcetype': ('django.db.models.fields.IntegerField', [], {}) | ||
110 | }, | ||
111 | u'orm.layerversiondependency': { | ||
112 | 'Meta': {'unique_together': "(('layer_source', 'up_id'),)", 'object_name': 'LayerVersionDependency'}, | ||
113 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'dependees'", 'to': u"orm['orm.Layer_Version']"}), | ||
114 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
115 | 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}), | ||
116 | 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'dependencies'", 'to': u"orm['orm.Layer_Version']"}), | ||
117 | 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}) | ||
118 | }, | ||
119 | u'orm.logmessage': { | ||
120 | 'Meta': {'object_name': 'LogMessage'}, | ||
121 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}), | ||
122 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
123 | 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
124 | 'lineno': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
125 | 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}), | ||
126 | 'pathname': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
127 | 'task': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Task']", 'null': 'True', 'blank': 'True'}) | ||
128 | }, | ||
129 | u'orm.machine': { | ||
130 | 'Meta': {'unique_together': "(('layer_source', 'up_id'),)", 'object_name': 'Machine'}, | ||
131 | 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
132 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
133 | 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}), | ||
134 | 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Layer_Version']"}), | ||
135 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
136 | 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}), | ||
137 | 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}) | ||
138 | }, | ||
139 | u'orm.package': { | ||
140 | 'Meta': {'object_name': 'Package'}, | ||
141 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}), | ||
142 | 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
143 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
144 | 'installed_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}), | ||
145 | 'installed_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
146 | 'license': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}), | ||
147 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
148 | 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Recipe']", 'null': 'True'}), | ||
149 | 'revision': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), | ||
150 | 'section': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}), | ||
151 | 'size': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
152 | 'summary': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
153 | 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}) | ||
154 | }, | ||
155 | u'orm.package_dependency': { | ||
156 | 'Meta': {'object_name': 'Package_Dependency'}, | ||
157 | 'dep_type': ('django.db.models.fields.IntegerField', [], {}), | ||
158 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_target'", 'to': u"orm['orm.Package']"}), | ||
159 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
160 | 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_source'", 'to': u"orm['orm.Package']"}), | ||
161 | 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']", 'null': 'True'}) | ||
162 | }, | ||
163 | u'orm.package_file': { | ||
164 | 'Meta': {'object_name': 'Package_File'}, | ||
165 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
166 | 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildfilelist_package'", 'to': u"orm['orm.Package']"}), | ||
167 | 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
168 | 'size': ('django.db.models.fields.IntegerField', [], {}) | ||
169 | }, | ||
170 | u'orm.project': { | ||
171 | 'Meta': {'object_name': 'Project'}, | ||
172 | 'bitbake_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.BitbakeVersion']"}), | ||
173 | 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
174 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
175 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
176 | 'release': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Release']"}), | ||
177 | 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), | ||
178 | 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), | ||
179 | 'user_id': ('django.db.models.fields.IntegerField', [], {'null': 'True'}) | ||
180 | }, | ||
181 | u'orm.projectlayer': { | ||
182 | 'Meta': {'object_name': 'ProjectLayer'}, | ||
183 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
184 | 'layercommit': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Layer_Version']", 'null': 'True'}), | ||
185 | 'optional': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
186 | 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}) | ||
187 | }, | ||
188 | u'orm.projecttarget': { | ||
189 | 'Meta': {'object_name': 'ProjectTarget'}, | ||
190 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
191 | 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}), | ||
192 | 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
193 | 'task': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}) | ||
194 | }, | ||
195 | u'orm.projectvariable': { | ||
196 | 'Meta': {'object_name': 'ProjectVariable'}, | ||
197 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
198 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
199 | 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}), | ||
200 | 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}) | ||
201 | }, | ||
202 | u'orm.recipe': { | ||
203 | 'Meta': {'object_name': 'Recipe'}, | ||
204 | 'bugtracker': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), | ||
205 | 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
206 | 'file_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}), | ||
207 | 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), | ||
208 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
209 | 'layer_source': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['orm.LayerSource']", 'null': 'True'}), | ||
210 | 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recipe_layer_version'", 'to': u"orm['orm.Layer_Version']"}), | ||
211 | 'license': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), | ||
212 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
213 | 'section': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
214 | 'summary': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
215 | 'up_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}), | ||
216 | 'up_id': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}), | ||
217 | 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}) | ||
218 | }, | ||
219 | u'orm.recipe_dependency': { | ||
220 | 'Meta': {'object_name': 'Recipe_Dependency'}, | ||
221 | 'dep_type': ('django.db.models.fields.IntegerField', [], {}), | ||
222 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_depends'", 'to': u"orm['orm.Recipe']"}), | ||
223 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
224 | 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_recipe'", 'to': u"orm['orm.Recipe']"}) | ||
225 | }, | ||
226 | u'orm.release': { | ||
227 | 'Meta': {'object_name': 'Release'}, | ||
228 | 'bitbake_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.BitbakeVersion']"}), | ||
229 | 'branch': ('django.db.models.fields.CharField', [], {'max_length': '32'}), | ||
230 | 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
231 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
232 | 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}) | ||
233 | }, | ||
234 | u'orm.releasedefaultlayer': { | ||
235 | 'Meta': {'object_name': 'ReleaseDefaultLayer'}, | ||
236 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
237 | 'layer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Layer']"}), | ||
238 | 'release': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Release']"}) | ||
239 | }, | ||
240 | u'orm.target': { | ||
241 | 'Meta': {'object_name': 'Target'}, | ||
242 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}), | ||
243 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
244 | 'image_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
245 | 'is_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
246 | 'license_manifest_path': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}), | ||
247 | 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
248 | }, | ||
249 | u'orm.target_file': { | ||
250 | 'Meta': {'object_name': 'Target_File'}, | ||
251 | 'directory': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'directory_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}), | ||
252 | 'group': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
253 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
254 | 'inodetype': ('django.db.models.fields.IntegerField', [], {}), | ||
255 | 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
256 | 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}), | ||
257 | 'permission': ('django.db.models.fields.CharField', [], {'max_length': '16'}), | ||
258 | 'size': ('django.db.models.fields.IntegerField', [], {}), | ||
259 | 'sym_target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'symlink_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}), | ||
260 | 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"}) | ||
261 | }, | ||
262 | u'orm.target_image_file': { | ||
263 | 'Meta': {'object_name': 'Target_Image_File'}, | ||
264 | 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '254'}), | ||
265 | 'file_size': ('django.db.models.fields.IntegerField', [], {}), | ||
266 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
267 | 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"}) | ||
268 | }, | ||
269 | u'orm.target_installed_package': { | ||
270 | 'Meta': {'object_name': 'Target_Installed_Package'}, | ||
271 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
272 | 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildtargetlist_package'", 'to': u"orm['orm.Package']"}), | ||
273 | 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"}) | ||
274 | }, | ||
275 | u'orm.task': { | ||
276 | 'Meta': {'ordering': "('order', 'recipe')", 'unique_together': "(('build', 'recipe', 'task_name'),)", 'object_name': 'Task'}, | ||
277 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_build'", 'to': u"orm['orm.Build']"}), | ||
278 | 'cpu_usage': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}), | ||
279 | 'disk_io': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
280 | 'elapsed_time': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}), | ||
281 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
282 | 'line_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
283 | 'logfile': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
284 | 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}), | ||
285 | 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
286 | 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '-1'}), | ||
287 | 'path_to_sstate_obj': ('django.db.models.fields.FilePathField', [], {'max_length': '500', 'blank': 'True'}), | ||
288 | 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'build_recipe'", 'to': u"orm['orm.Recipe']"}), | ||
289 | 'script_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
290 | 'source_url': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
291 | 'sstate_checksum': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
292 | 'sstate_result': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
293 | 'task_executed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
294 | 'task_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
295 | 'work_directory': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}) | ||
296 | }, | ||
297 | u'orm.task_dependency': { | ||
298 | 'Meta': {'object_name': 'Task_Dependency'}, | ||
299 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_depends'", 'to': u"orm['orm.Task']"}), | ||
300 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
301 | 'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_task'", 'to': u"orm['orm.Task']"}) | ||
302 | }, | ||
303 | u'orm.toastersetting': { | ||
304 | 'Meta': {'object_name': 'ToasterSetting'}, | ||
305 | 'helptext': ('django.db.models.fields.TextField', [], {}), | ||
306 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
307 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '63'}), | ||
308 | 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}) | ||
309 | }, | ||
310 | u'orm.toastersettingdefaultlayer': { | ||
311 | 'Meta': {'object_name': 'ToasterSettingDefaultLayer'}, | ||
312 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
313 | 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Layer_Version']"}) | ||
314 | }, | ||
315 | u'orm.variable': { | ||
316 | 'Meta': {'object_name': 'Variable'}, | ||
317 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'variable_build'", 'to': u"orm['orm.Build']"}), | ||
318 | 'changed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
319 | 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
320 | 'human_readable_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), | ||
321 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
322 | 'variable_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
323 | 'variable_value': ('django.db.models.fields.TextField', [], {'blank': 'True'}) | ||
324 | }, | ||
325 | u'orm.variablehistory': { | ||
326 | 'Meta': {'object_name': 'VariableHistory'}, | ||
327 | 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}), | ||
328 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
329 | 'line_number': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
330 | 'operation': ('django.db.models.fields.CharField', [], {'max_length': '64'}), | ||
331 | 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
332 | 'variable': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vhistory'", 'to': u"orm['orm.Variable']"}) | ||
333 | } | ||
334 | } | ||
335 | |||
336 | 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 309f8ea5be..2fd504cb5b 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -51,6 +51,9 @@ class ToasterSetting(models.Model): | |||
51 | helptext = models.TextField() | 51 | helptext = models.TextField() |
52 | value = models.CharField(max_length=255) | 52 | value = models.CharField(max_length=255) |
53 | 53 | ||
54 | def __unicode__(self): | ||
55 | return "Setting %s" % self.name | ||
56 | |||
54 | class ToasterSettingDefaultLayer(models.Model): | 57 | class ToasterSettingDefaultLayer(models.Model): |
55 | layer_version = models.ForeignKey('Layer_Version') | 58 | layer_version = models.ForeignKey('Layer_Version') |
56 | 59 | ||
@@ -347,7 +350,7 @@ class Package(models.Model): | |||
347 | installed_name = models.CharField(max_length=100, default='') | 350 | installed_name = models.CharField(max_length=100, default='') |
348 | version = models.CharField(max_length=100, blank=True) | 351 | version = models.CharField(max_length=100, blank=True) |
349 | revision = models.CharField(max_length=32, blank=True) | 352 | revision = models.CharField(max_length=32, blank=True) |
350 | summary = models.CharField(max_length=200, blank=True) | 353 | summary = models.TextField(blank=True) |
351 | description = models.TextField(blank=True) | 354 | description = models.TextField(blank=True) |
352 | size = models.IntegerField(default=0) | 355 | size = models.IntegerField(default=0) |
353 | installed_size = models.IntegerField(default=0) | 356 | installed_size = models.IntegerField(default=0) |
@@ -420,7 +423,7 @@ class Recipe(models.Model): | |||
420 | name = models.CharField(max_length=100, blank=True) # pn | 423 | name = models.CharField(max_length=100, blank=True) # pn |
421 | version = models.CharField(max_length=100, blank=True) # pv | 424 | version = models.CharField(max_length=100, blank=True) # pv |
422 | layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version') | 425 | layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version') |
423 | summary = models.CharField(max_length=100, blank=True) | 426 | summary = models.TextField(blank=True) |
424 | description = models.TextField(blank=True) | 427 | description = models.TextField(blank=True) |
425 | section = models.CharField(max_length=100, blank=True) | 428 | section = models.CharField(max_length=100, blank=True) |
426 | license = models.CharField(max_length=200, blank=True) | 429 | license = models.CharField(max_length=200, blank=True) |
@@ -585,8 +588,8 @@ class LayerIndexLayerSource(LayerSource): | |||
585 | print "EE: could not connect to %s, skipping update: %s\n%s" % (self.apiurl, e, traceback.format_exc(e)) | 588 | print "EE: could not connect to %s, skipping update: %s\n%s" % (self.apiurl, e, traceback.format_exc(e)) |
586 | return | 589 | return |
587 | 590 | ||
588 | # update branches; only those that we already have names listed in the database | 591 | # update branches; only those that we already have names listed in the Releases table |
589 | whitelist_branch_names = map(lambda x: x.name, Branch.objects.all()) | 592 | whitelist_branch_names = map(lambda x: x.branch, Release.objects.all()) |
590 | 593 | ||
591 | branches_info = _get_json_response(apilinks['branches'] | 594 | branches_info = _get_json_response(apilinks['branches'] |
592 | + "?filter=name:%s" % "OR".join(whitelist_branch_names)) | 595 | + "?filter=name:%s" % "OR".join(whitelist_branch_names)) |
@@ -667,7 +670,7 @@ class LayerIndexLayerSource(LayerSource): | |||
667 | + "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self))) | 670 | + "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self))) |
668 | ) | 671 | ) |
669 | for ri in recipes_info: | 672 | for ri in recipes_info: |
670 | ro, created = Recipe.objects.get_or_create(layer_source = self, up_id = ri['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = mi['layerbranch'])) | 673 | ro, created = Recipe.objects.get_or_create(layer_source = self, up_id = ri['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = ri['layerbranch'])) |
671 | 674 | ||
672 | ro.up_date = ri['updated'] | 675 | ro.up_date = ri['updated'] |
673 | 676 | ||
@@ -691,6 +694,9 @@ class BitbakeVersion(models.Model): | |||
691 | branch = models.CharField(max_length=32) | 694 | branch = models.CharField(max_length=32) |
692 | dirpath = models.CharField(max_length=255) | 695 | dirpath = models.CharField(max_length=255) |
693 | 696 | ||
697 | def __unicode__(self): | ||
698 | return "%s (%s)" % (self.name, self.branch) | ||
699 | |||
694 | 700 | ||
695 | class Release(models.Model): | 701 | class Release(models.Model): |
696 | name = models.CharField(max_length=32, unique = True) | 702 | name = models.CharField(max_length=32, unique = True) |
@@ -734,7 +740,7 @@ class Layer(models.Model): | |||
734 | vcs_url = GitURLField(default = None, null = True) | 740 | vcs_url = GitURLField(default = None, null = True) |
735 | vcs_web_file_base_url = models.URLField(null = True, default = None) | 741 | vcs_web_file_base_url = models.URLField(null = True, default = None) |
736 | 742 | ||
737 | summary = models.CharField(max_length=200, help_text='One-line description of the layer', null = True, default = None) | 743 | summary = models.TextField(help_text='One-line description of the layer', null = True, default = None) |
738 | description = models.TextField(null = True, default = None) | 744 | description = models.TextField(null = True, default = None) |
739 | 745 | ||
740 | def __unicode__(self): | 746 | def __unicode__(self): |