Skip to content

Commit

Permalink
Fixing issue 11
Browse files Browse the repository at this point in the history
  • Loading branch information
seg1129 committed Apr 28, 2017
1 parent 36d9c72 commit d21133a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ehb_service/apps/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

class SubjectAdmin(admin.ModelAdmin):
list_filter = ['organization', 'created', 'modified']
search_fields = ['organization', 'last_name', 'organization_subject_id']
# Search Field does not work due to encryption. need to override query
search_fields = ['organization__name', 'last_name', 'organization_subject_id']
list_display = ['last_name', 'first_name', 'organization', 'organization_subject_id']

admin.site.register(Subject, SubjectAdmin)
Expand All @@ -40,6 +41,8 @@ class ExternalSystemAdmin(admin.ModelAdmin):
class ExternalRecordAdmin(admin.ModelAdmin):
list_filter = ['external_system', 'created']
list_display = ['subject', 'external_system', 'path', 'record_id']
# need to overide this search query to decrypt subject field
search_fields = ['subject__last_name']
raw_id_fields = ['subject', 'external_system']

admin.site.register(ExternalRecord, ExternalRecordAdmin)
Expand All @@ -53,14 +56,16 @@ class OrganizationAdmin(admin.ModelAdmin):

class SubjectGroupAdmin(admin.ModelAdmin):
list_filter = ['group']
search_fields = ['group']
# need to overide this search query to decrypt subject field
search_fields = ['group__name']
list_display = ['group']

admin.site.register(SubjectGroup, SubjectGroupAdmin)

class ExternalRecordGroupAdmin(admin.ModelAdmin):
list_filter = ['group']
search_fields = ['group']
# need to overide this search query to decrypt subject field
search_fields = ['group__name']
list_display = ['group']

admin.site.register(ExternalRecordGroup, ExternalRecordGroupAdmin)
Expand Down

0 comments on commit d21133a

Please sign in to comment.