Some checks are pending
SonarQube Scan / SonarQube Trigger (push) Waiting to run
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 7s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 7s
38 lines
910 B
Python
38 lines
910 B
Python
from django.contrib import admin
|
|
|
|
from .models import Box, BoxType, Thing, ThingType
|
|
|
|
|
|
@admin.register(BoxType)
|
|
class BoxTypeAdmin(admin.ModelAdmin):
|
|
"""Admin configuration for BoxType model."""
|
|
|
|
list_display = ('name', 'width', 'height', 'length')
|
|
search_fields = ('name',)
|
|
|
|
|
|
@admin.register(Box)
|
|
class BoxAdmin(admin.ModelAdmin):
|
|
"""Admin configuration for Box model."""
|
|
|
|
list_display = ('id', 'box_type')
|
|
list_filter = ('box_type',)
|
|
search_fields = ('id',)
|
|
|
|
|
|
@admin.register(ThingType)
|
|
class ThingTypeAdmin(admin.ModelAdmin):
|
|
"""Admin configuration for ThingType model."""
|
|
|
|
list_display = ('name',)
|
|
search_fields = ('name',)
|
|
|
|
|
|
@admin.register(Thing)
|
|
class ThingAdmin(admin.ModelAdmin):
|
|
"""Admin configuration for Thing model."""
|
|
|
|
list_display = ('name', 'thing_type', 'box')
|
|
list_filter = ('thing_type', 'box')
|
|
search_fields = ('name', 'description')
|