Show a clickable url alongside the url field
This commit is contained in:
parent
8b2508fbc5
commit
6ff3d84c3b
1 changed files with 5 additions and 1 deletions
|
@ -84,7 +84,7 @@ class RangeAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
class OrganizationAdmin(admin.ModelAdmin):
|
class OrganizationAdmin(admin.ModelAdmin):
|
||||||
readonly_fields = ('org_num1',)
|
readonly_fields = ('org_num1', 'org_url',)
|
||||||
search_fields = ['organisation_search', 'org_alpha_search', 'organisation_2', 'organisation_3', 'subject']
|
search_fields = ['organisation_search', 'org_alpha_search', 'organisation_2', 'organisation_3', 'subject']
|
||||||
list_display = ['organisation_english', 'country', 'city']
|
list_display = ['organisation_english', 'country', 'city']
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
|
@ -107,11 +107,15 @@ class OrganizationAdmin(admin.ModelAdmin):
|
||||||
'classes': ('collapse',),
|
'classes': ('collapse',),
|
||||||
'fields': (('tel', 'email'),
|
'fields': (('tel', 'email'),
|
||||||
'url',
|
'url',
|
||||||
|
'org_url',
|
||||||
'tags',
|
'tags',
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def org_url(self, instance):
|
||||||
|
return '<a href="%s" target="_blank">%s</a>' % (str(instance.url).strip("#"), str(instance.url).strip("#"))
|
||||||
|
|
||||||
|
|
||||||
class FieldAdmin(admin.ModelAdmin):
|
class FieldAdmin(admin.ModelAdmin):
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
|
Loading…
Reference in a new issue