2020-01-11 17:54:31 +01:00
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
# Register your models here.
|
2020-01-11 18:28:48 +01:00
|
|
|
|
|
|
|
from .models import (
|
2020-01-12 12:46:49 +01:00
|
|
|
OperatingSystem,
|
|
|
|
Software,
|
|
|
|
SoftwareArchitecture,
|
|
|
|
SoftwareCategory,
|
2020-01-11 18:28:48 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-01-12 12:46:49 +01:00
|
|
|
class OperatingSystemAdmin(admin.ModelAdmin):
|
|
|
|
def get_model_perms(self, request):
|
|
|
|
"""
|
|
|
|
Return empty perms dict thus hiding the model from admin index.
|
|
|
|
"""
|
|
|
|
return {}
|
2020-01-11 18:28:48 +01:00
|
|
|
|
|
|
|
|
2020-01-12 12:46:49 +01:00
|
|
|
class SoftwareArchitectureAdmin(admin.ModelAdmin):
|
|
|
|
def get_model_perms(self, request):
|
|
|
|
"""
|
|
|
|
Return empty perms dict thus hiding the model from admin index.
|
|
|
|
"""
|
|
|
|
return {}
|
2020-01-11 18:28:48 +01:00
|
|
|
|
|
|
|
|
2020-01-12 12:46:49 +01:00
|
|
|
class SoftwareCategoryAdmin(admin.ModelAdmin):
|
|
|
|
def get_model_perms(self, request):
|
|
|
|
"""
|
|
|
|
Return empty perms dict thus hiding the model from admin index.
|
|
|
|
"""
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(OperatingSystem, OperatingSystemAdmin)
|
|
|
|
admin.site.register(Software)
|
|
|
|
admin.site.register(SoftwareArchitecture, SoftwareArchitectureAdmin)
|
|
|
|
admin.site.register(SoftwareCategory, SoftwareCategoryAdmin)
|