diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-06-16 16:00:26 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-26 09:27:33 +0100 |
commit | df48243970fac633586eb99c9baf3090123c681c (patch) | |
tree | a616118bed5fa9831a5ddbf0033cc5833d51e80a /bitbake/lib/toaster/bldcollector/admin.py | |
parent | 62288a66896416beaef1d85aeefc8dab0835f4f8 (diff) | |
download | poky-df48243970fac633586eb99c9baf3090123c681c.tar.gz |
bitbake: toaster: split orm app into it's own module and app
The orm application was also the django application to collect the build
information. Splitting this module up into it's functional parts. orm
for the data module and bldcollector for build collection data.
(Bitbake rev: 8ca10764ffd6cfec12cbfeabf240d81213a07845)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcollector/admin.py')
-rw-r--r-- | bitbake/lib/toaster/bldcollector/admin.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcollector/admin.py b/bitbake/lib/toaster/bldcollector/admin.py new file mode 100644 index 0000000000..c1f85d73d5 --- /dev/null +++ b/bitbake/lib/toaster/bldcollector/admin.py | |||
@@ -0,0 +1,33 @@ | |||
1 | from django.contrib import admin | ||
2 | from django.contrib.admin.filters import RelatedFieldListFilter | ||
3 | from orm.models import BitbakeVersion, Release, LayerSource, ToasterSetting | ||
4 | from django.forms.widgets import Textarea | ||
5 | from django import forms | ||
6 | import django.db.models as models | ||
7 | |||
8 | from django.contrib.admin import widgets, helpers | ||
9 | |||
10 | class LayerSourceAdmin(admin.ModelAdmin): | ||
11 | pass | ||
12 | |||
13 | class BitbakeVersionAdmin(admin.ModelAdmin): | ||
14 | |||
15 | # we override the formfield for db URLField because of broken URL validation | ||
16 | |||
17 | def formfield_for_dbfield(self, db_field, **kwargs): | ||
18 | if isinstance(db_field, models.fields.URLField): | ||
19 | return forms.fields.CharField() | ||
20 | return super(BitbakeVersionAdmin, self).formfield_for_dbfield(db_field, **kwargs) | ||
21 | |||
22 | |||
23 | |||
24 | class ReleaseAdmin(admin.ModelAdmin): | ||
25 | pass | ||
26 | |||
27 | class ToasterSettingAdmin(admin.ModelAdmin): | ||
28 | pass | ||
29 | |||
30 | admin.site.register(LayerSource, LayerSourceAdmin) | ||
31 | admin.site.register(BitbakeVersion, BitbakeVersionAdmin) | ||
32 | admin.site.register(Release, ReleaseAdmin) | ||
33 | admin.site.register(ToasterSetting, ToasterSettingAdmin) | ||