diff --git a/app/admin.py b/app/admin.py index 5ff06b2..4fbbbca 100644 --- a/app/admin.py +++ b/app/admin.py @@ -46,6 +46,37 @@ class PersonAdmin(admin.ModelAdmin): class ResourceAdmin(admin.ModelAdmin): search_fields = ['title', 'url', 'citation', 'abstract'] + readonly_fields = ['resource_url'] + # search_fields = ['organisation_search', 'org_alpha_search', 'organisation_2', 'organisation_3', 'subject'] + # list_display = ['organisation_english', 'country', 'city'] + # fieldsets = ( + # (None, { + # 'fields': ( + # ('org_num1', 'acronym', 'category', 'subject'), + # 'organisation_english', + # ('organisation_2', 'organisation_3'), + # 'organisation_original', + # ) + # }), + # ('Address', { + # 'classes': ('collapse',), + # 'fields': ( + # ('street', 'postcode', 'city'), + # ('po_box', 'country', 'lat_long'), + # ) + # }), + # ('Other details', { + # 'classes': ('collapse',), + # 'fields': (('tel', 'email'), + # 'url', + # 'org_url', + # 'tags', + # ), + # }) + # ) + + def resource_url(self, instance): + return '%s' % (str(instance.url).strip("#"), str(instance.url).strip("#")) class RangeAdmin(admin.ModelAdmin): @@ -84,7 +115,7 @@ class RangeAdmin(admin.ModelAdmin): class OrganizationAdmin(admin.ModelAdmin): - readonly_fields = ('org_num1', 'org_url',) + readonly_fields = ('org_num1', 'org_url') search_fields = ['organisation_search', 'org_alpha_search', 'organisation_2', 'organisation_3', 'subject'] list_display = ['organisation_english', 'country', 'city'] fieldsets = (