Add fitlers for Satellite and Observation admin views
parent
72684ffcb9
commit
ac6eae2907
|
@ -49,7 +49,8 @@ class StationAdmin(admin.ModelAdmin):
|
|||
|
||||
@admin.register(Satellite)
|
||||
class SatelliteAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'norad_cat_id')
|
||||
list_display = ('id', 'name', 'norad_cat_id', 'manual_tle', 'norad_follow_id', 'status')
|
||||
list_filter = ('status', 'manual_tle',)
|
||||
readonly_fields = ('name', 'names', 'image')
|
||||
|
||||
|
||||
|
@ -64,7 +65,7 @@ class TleAdmin(admin.ModelAdmin):
|
|||
|
||||
@admin.register(Transmitter)
|
||||
class TransmitterAdmin(admin.ModelAdmin):
|
||||
list_display = ('uuid', 'description', 'satellite', 'uplink_low',
|
||||
list_display = ('id', 'uuid', 'description', 'satellite', 'uplink_low',
|
||||
'uplink_high', 'downlink_low', 'downlink_high')
|
||||
search_fields = ('satellite', 'uuid')
|
||||
list_filter = ('mode', 'invert')
|
||||
|
@ -78,15 +79,10 @@ class DataDemodInline(admin.TabularInline):
|
|||
|
||||
@admin.register(Observation)
|
||||
class ObservationAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'author', 'satellite', 'transmitter', 'start_date', 'end_date')
|
||||
list_display = ('id', 'author', 'satellite', 'transmitter', 'start', 'end')
|
||||
list_filter = ('start', 'end')
|
||||
search_fields = ('satellite', 'author')
|
||||
inlines = [
|
||||
DataDemodInline,
|
||||
]
|
||||
|
||||
def start_date(self, obj):
|
||||
return obj.start.strftime('%d.%m.%Y, %H:%M')
|
||||
|
||||
def end_date(self, obj):
|
||||
return obj.end.strftime('%d.%m.%Y, %H:%M')
|
||||
readonly_fields = ('tle',)
|
||||
|
|
|
@ -355,7 +355,8 @@ class Tle(models.Model):
|
|||
ordering = ['tle0']
|
||||
|
||||
def __unicode__(self):
|
||||
return self.tle0
|
||||
uni_name = "%d - %s" % (self.id, self.tle0)
|
||||
return uni_name
|
||||
|
||||
|
||||
class Transmitter(models.Model):
|
||||
|
|
Loading…
Reference in New Issue