Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/optimization fixes #55

Merged
merged 2 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion observation_portal/observations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class ConfigurationStatusAdmin(admin.ModelAdmin):


class SummaryAdmin(admin.ModelAdmin):
list_display = ('start', 'end', 'state', 'reason', 'time_completed')
list_display = ('id', 'start', 'end', 'state', 'reason', 'time_completed')
list_filter = ('state', )
raw_id_fields = ('configuration_status', )


admin.site.register(Observation, ObservationAdmin)
Expand Down
2 changes: 1 addition & 1 deletion observation_portal/observations/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ class ConfigurationStatusFilter(django_filters.FilterSet):

class Meta:
model = ConfigurationStatus
fields = '__all__'
fields = ('guide_camera_name',)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about instrument name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instrument name is included as a filterable field since it is declared in the filterset a few lines up

2 changes: 2 additions & 0 deletions observation_portal/proposals/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ def proposal_title(self, obj):

class ProposalInviteAdmin(admin.ModelAdmin):
model = ProposalInvite
raw_id_fields = ['proposal']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do raw_id_fields still give you a link to that admin object?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!



class ProposalNotificationAdmin(admin.ModelAdmin):
model = ProposalNotification
raw_id_fields = ['proposal', 'user']


admin.site.register(Semester, SemesterAdmin)
Expand Down
6 changes: 6 additions & 0 deletions observation_portal/requestgroups/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class RequestGroupAdmin(admin.ModelAdmin):
list_filter = ('state', 'created', 'modified')
search_fields = ('name',)
readonly_fields = ('requests', 'requests_count')
raw_id_fields = ('proposal', 'submitter')

def requests_count(self, obj):
return obj.requests.count()
Expand Down Expand Up @@ -106,6 +107,7 @@ class LocationAdmin(admin.ModelAdmin):
)
form = LocationForm
list_filter = ('telescope_class',)
raw_id_fields = ('request',)


class TargetAdmin(admin.ModelAdmin):
Expand Down Expand Up @@ -142,6 +144,7 @@ class TargetAdmin(admin.ModelAdmin):
'dailymot',
'epochofperih',
)
raw_id_fields = ('configuration', )
list_filter = ('type',)
search_fields = ('name',)

Expand Down Expand Up @@ -178,6 +181,7 @@ class ConstraintsAdmin(admin.ModelAdmin):
'max_seeing',
'min_transparency',
)
raw_id_fields = ('configuration',)


class AcquisitionConfigAdmin(admin.ModelAdmin):
Expand All @@ -186,6 +190,7 @@ class AcquisitionConfigAdmin(admin.ModelAdmin):
'configuration',
'mode',
)
raw_id_fields = ('configuration',)


class GuidingConfigAdmin(admin.ModelAdmin):
Expand All @@ -196,6 +201,7 @@ class GuidingConfigAdmin(admin.ModelAdmin):
'mode',
'exposure_time'
)
raw_id_fields = ('configuration',)


admin.site.register(Constraints, ConstraintsAdmin)
Expand Down