mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
* FIX: Remove misleading admin site title * Moved across assets_id sorting to use proper numeric values. Also mofifies SQL command to find free asset IDs so that it works on postgres. * Changed generateSampleAssetsData.py to include prefices on some cables. * Fixed pep8 * Fixed missed migration * Ensured hidden asset fields are completed on every database write * CMULTI is a thing, and therefore a max prefix length of 5 cannot be a thing
33 lines
876 B
Python
33 lines
876 B
Python
from django.contrib import admin
|
|
from assets import models as assets
|
|
|
|
|
|
@admin.register(assets.AssetCategory)
|
|
class AssetCategoryAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'name']
|
|
ordering = ['id']
|
|
|
|
|
|
@admin.register(assets.AssetStatus)
|
|
class AssetStatusAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'name']
|
|
ordering = ['id']
|
|
|
|
|
|
@admin.register(assets.Supplier)
|
|
class SupplierAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'name']
|
|
ordering = ['id']
|
|
|
|
|
|
@admin.register(assets.Asset)
|
|
class AssetAdmin(admin.ModelAdmin):
|
|
list_display = ['id', 'asset_id', 'description', 'category', 'status']
|
|
list_filter = ['is_cable', 'category']
|
|
search_fields = ['id', 'asset_id', 'description']
|
|
|
|
|
|
@admin.register(assets.Connector)
|
|
class ConnectorAdmin(admin.ModelAdmin):
|
|
list_display = ['id', '__str__', 'current_rating', 'voltage_rating', 'num_pins']
|