summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcollector/admin.py
blob: 7b69ecd09e7e78734db21c82bb050b36c65acc57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from django.contrib import admin
from django.contrib.admin.filters import RelatedFieldListFilter
from orm.models import BitbakeVersion, Release, ToasterSetting
from django.forms.widgets import Textarea
from django import forms
import django.db.models as models

from django.contrib.admin import widgets, helpers

class BitbakeVersionAdmin(admin.ModelAdmin):

    # we override the formfield for db URLField because of broken URL validation

    def formfield_for_dbfield(self, db_field, **kwargs):
        if isinstance(db_field, models.fields.URLField):
            return forms.fields.CharField()
        return super(BitbakeVersionAdmin, self).formfield_for_dbfield(db_field, **kwargs)



class ReleaseAdmin(admin.ModelAdmin):
    pass

class ToasterSettingAdmin(admin.ModelAdmin):
    pass

admin.site.register(BitbakeVersion, BitbakeVersionAdmin)
admin.site.register(Release, ReleaseAdmin)
admin.site.register(ToasterSetting, ToasterSettingAdmin)