Skip to content

Commit

Permalink
dont make fields readonly if they can be raw (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rloomans committed Dec 18, 2016
1 parent 0f7027b commit 7e7d30b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion teamtemp/responses/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

from teamtemp.responses.models import *


def _request_id(obj):
return obj.request.id
_request_id.short_description = 'Request ID'


class WordCloudImageAdmin(admin.ModelAdmin):
list_display = ("id", "word_hash", "image_url", "creation_date")
list_display_links = ("id", "word_hash", "image_url")
Expand All @@ -28,17 +30,19 @@ class TemperatureResponseAdmin(admin.ModelAdmin):
list_display = ("id", _request_id, "responder", "team_name", "score", "word", "response_date")
list_filter = ("archived", )
readonly_fields = ("id", )
raw_id_fields = ("responder", )
raw_id_fields = ("responder", "request")


class TeamResponseHistoryAdmin(admin.ModelAdmin):
list_display = ("id", _request_id, "team_name", "average_score", "responder_count", "archive_date")
readonly_fields = ("id", )
raw_id_fields = ("request", )


class TeamsAdmin(admin.ModelAdmin):
list_display = ("id", _request_id, "team_name", "dept_name", "site_name", "region_name", "creation_date", "modified_date")
readonly_fields = ("id", "creation_date", "modified_date")
raw_id_fields = ("request", )


admin.site.register(WordCloudImage, WordCloudImageAdmin)
Expand Down

0 comments on commit 7e7d30b

Please sign in to comment.