Victor Seva 3 years ago
parent beb1909fe7
commit 8da6c9cb48

@ -1,4 +1,4 @@
# Copyright (C) 2017 The Sipwise Team - http://sipwise.com
# Copyright (C) 2017-2022 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@ -13,12 +13,20 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from . import models
class BuildReleaseResource(resources.ModelResource):
class Meta:
model = models.BuildRelease
@admin.register(models.BuildRelease)
class BuildReleaseAdmin(admin.ModelAdmin):
class BuildReleaseAdmin(ImportExportModelAdmin):
resource_class = BuildReleaseResource
list_filter = ("release",)
readonly_fields = ("projects",)
modify_readonly_fields = (

@ -0,0 +1,29 @@
# Copyright (C) 2022 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from . import models
class WorkfrontNoteInfoResource(resources.ModelResource):
class Meta:
model = models.WorkfrontNoteInfo
@admin.register(models.WorkfrontNoteInfo)
class WorkfrontNoteInfoAdmin(ImportExportModelAdmin):
resource_class = WorkfrontNoteInfoResource

@ -1,4 +1,4 @@
# Copyright (C) 2020 The Sipwise Team - http://sipwise.com
# Copyright (C) 2020-2022 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@ -13,10 +13,17 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from . import models
class ReleaseChangedResource(resources.ModelResource):
class Meta:
model = models.ReleaseChanged
@admin.register(models.ReleaseChanged)
class ReleaseChangedAdmin(admin.ModelAdmin):
pass
class ReleaseChangedAdmin(ImportExportModelAdmin):
resource_class = ReleaseChangedResource

@ -1,24 +1,49 @@
# Copyright (C) 2016 The Sipwise Team - http://sipwise.com
# Copyright (C) 2016-2022 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from . import models
class ProjectResource(resources.ModelResource):
class Meta:
model = models.Project
class DockerTagResource(resources.ModelResource):
class Meta:
model = models.DockerTag
class DockerImageResource(resources.ModelResource):
class Meta:
model = models.DockerImage
@admin.register(models.DockerTag)
class DockerTagAdmin(ImportExportModelAdmin):
resource_class = DockerTagResource
@admin.register(models.DockerImage)
class DockerImageAdmin(ImportExportModelAdmin):
resource_class = DockerImageResource
@admin.register(models.Project)
class ProjectAdmin(admin.ModelAdmin):
pass
class ProjectAdmin(ImportExportModelAdmin):
resource_class = ProjectResource

@ -1,27 +1,40 @@
# Copyright (C) 2015 The Sipwise Team - http://sipwise.com
# Copyright (C) 2015-2022 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib import admin
from repoapi import models
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from . import models
class JenkinsBuildInfoResource(resources.ModelResource):
class Meta:
model = models.JenkinsBuildInfo
class GerritRepoInfoResource(resources.ModelResource):
class Meta:
model = models.GerritRepoInfo
@admin.register(models.JenkinsBuildInfo)
class JenkinsBuildInfoAdmin(admin.ModelAdmin):
list_filter = ('param_release', 'projectname')
class JenkinsBuildInfoAdmin(ImportExportModelAdmin):
resource_class = JenkinsBuildInfoResource
list_filter = ("param_release", "projectname")
@admin.register(models.GerritRepoInfo)
class GerritRepoInfoAdmin(admin.ModelAdmin):
pass
class GerritRepoInfoAdmin(ImportExportModelAdmin):
resource_class = GerritRepoInfoResource

Loading…
Cancel
Save