PageRenderTime 103ms CodeModel.GetById 60ms app.highlight 16ms RepoModel.GetById 24ms app.codeStats 1ms

/rak/rfspectrum/rfspectrum_admin.py

http://rfdjango.googlecode.com/
Python | 123 lines | 102 code | 18 blank | 3 comment | 0 complexity | 06e455f746414128ac059dbb0ea39d02 MD5 | raw file
  1# -*- coding: utf-8 -*-
  2from django.contrib import admin
  3from rfspectrum.models import Antenna
  4from rfspectrum.models import AntennaSystem
  5from rfspectrum.models import CommandDictionary
  6from rfspectrum.models import DefaultSpectrum
  7from rfspectrum.models import Gps
  8from rfspectrum.models import Incident
  9from rfspectrum.models import Manufacturer
 10from rfspectrum.models import MonitoringStation
 11from rfspectrum.models import MeasurementDevice
 12from rfspectrum.models import MeasurementSetting
 13from rfspectrum.models import RFSpectrumDefinition
 14from rfspectrum.models import RFSpectrum
 15from rfspectrum.models import Rotator
 16from rfspectrum.models import Switcher
 17
 18class ManufacturerAdmin(admin.ModelAdmin):
 19    list_display = ('name',)
 20    paginate = 10
 21
 22class AntennaAdmin(admin.ModelAdmin):
 23    list_display = ('manufacturer','model','type','frequency_span')
 24    list_filter = ('manufacturer','model','type')
 25    ordering = ('manufacturer','frequency_span')
 26    paginate = 10
 27
 28class MonitoringStationAdmin(admin.ModelAdmin):
 29        list_display = ('name','type','gps','operational','portalvisibility')
 30        list_filter = ('type','operational','portalvisibility')
 31
 32
 33class MeasurementDeviceAdmin(admin.ModelAdmin):
 34    list_display = ('monitoring_station','manufacturer','model','type','ipaddress','port')
 35    list_filter = ('monitoring_station','manufacturer','model','type')
 36
 37class AntennaSystemAdmin(admin.ModelAdmin):
 38    #list_display = ('description','monitorstation','ipaddress','rotrport', \
 39    #                'swport', 'defaultantena','polar_antene','antenna_height','defaultantposition')
 40    list_display = ('monitoring_station','ipaddress','switcher_port','description')
 41    list_filter = ('monitoring_station',)
 42    ordering = ('monitoring_station',)
 43    paginate = 10
 44
 45class CommandDictionaryAdmin(admin.ModelAdmin):
 46    list_display = ('command','manufacturer','model','version','type','equipment_command')
 47    list_filter = ('command','manufacturer','type')
 48    ordering = ('command','manufacturer','type')
 49    paginate = '10'
 50
 51class RFSpectrumDefinitionAdmin(admin.ModelAdmin):
 52    list_display = ('band','freq_start','freq_stop','measurement_setting')
 53    list_filter = ('band',)
 54    ordering = ('freq_start','freq_stop')
 55    paginate = 20
 56
 57class RFSpectrumAdmin(admin.ModelAdmin):
 58    list_display = ('date','time','spectrum_definition','scandata')
 59    list_filter = ('date','spectrum_definition')
 60    ordering = ('date','time')
 61    paginate = 10
 62
 63class DefaultSpectrumAdmin(admin.ModelAdmin):
 64    list_display = ('rfspectrum_definition','measurement_setting','spectrumlabel',)
 65    list_filter = ('date','rfspectrum_definition')
 66    ordering = ('date','time')
 67    paginate = 10
 68
 69class RotatorAdmin(admin.ModelAdmin):
 70    list_display = ('manufacturer','model','comm_port',)
 71    list_filter = ('manufacturer','model')
 72    ordering = ('manufacturer','model')
 73    paginate = 10
 74    
 75class SwitcherAdmin(admin.ModelAdmin):
 76    list_display = ('manufacturer','model','comm_port',)
 77    list_filter = ('manufacturer','model')
 78    ordering = ('manufacturer','model')
 79    paginate = 10    
 80    
 81class IncidentAdmin(admin.ModelAdmin):
 82    list_display = ('spectrum','onfrequency','description','assignedto','resolvedby','resolvexplanation')
 83    list_filter = ('spectrum','assignedto','resolvedby')
 84    ordering = ('spectrum','resolvedby')
 85    paginate = 10
 86
 87class FunctionAdmin(admin.ModelAdmin):
 88    list_display = ('name','setting','path')
 89    list_filter = ('name',)
 90    ordering = ('name',)
 91    paginate = 10
 92    
 93class MeasurementTaskAdmin(admin.ModelAdmin):
 94    list_display = ('date','time','function','onetime','priority','donedatetime')
 95    list_filter = ('date','time','function','donedatetime')
 96    ordering = ('donedatetime','function')
 97    paginate = 10
 98    
 99class IncidentAdmin(admin.ModelAdmin):
100    list_display = ('spectrum','onfrequency','description','assignedto','resolvedby','resolvexplanation')
101    list_filter = ('spectrum','assignedto','resolvedby')
102    ordering = ('spectrum','resolvedby')
103    paginate = 10
104    
105class GpsAdmin(admin.ModelAdmin):
106    list_display = ('name','longitude','latitude')
107    list_filter = ('name',)
108    ordering = ('name',)
109    paginate = 20 
110   
111admin.site.register(Antenna, AntennaAdmin)
112admin.site.register(AntennaSystem, AntennaSystemAdmin)    
113admin.site.register(CommandDictionary, CommandDictionaryAdmin)
114admin.site.register(DefaultSpectrum, DefaultSpectrumAdmin)
115admin.site.register(Incident, IncidentAdmin)
116admin.site.register(Manufacturer, ManufacturerAdmin)
117admin.site.register(MonitoringStation, MonitoringStationAdmin)
118admin.site.register(MeasurementDevice, MeasurementDeviceAdmin)
119admin.site.register(RFSpectrum, RFSpectrumAdmin)
120admin.site.register(RFSpectrumDefinition, RFSpectrumDefinitionAdmin)
121admin.site.register(Rotator, RotatorAdmin)
122admin.site.register(Switcher,SwitcherAdmin)
123admin.site.register(Gps,GpsAdmin)