Skip to content
Snippets Groups Projects
Commit 7139edd8 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'element-image-link' into 'master'

Link to image in Element admin

Closes #1310

See merge request teklia/arkindex/backend!1805
parents 38de536c 322a9abf
No related branches found
No related tags found
1 merge request!1805Link to image in Element admin
......@@ -86,9 +86,9 @@ class MetaDataInline(admin.TabularInline):
class ElementAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'type', 'corpus', )
list_filter = ['type__slug', 'corpus']
fields = ('id', 'type', 'name', 'corpus', 'confidence', 'worker_run', )
raw_id_fields = ('worker_run', )
readonly_fields = ('id', 'corpus', )
fields = ('id', 'type', 'name', 'image', 'corpus', 'confidence', 'worker_run', )
raw_id_fields = ('worker_run',)
readonly_fields = ('id', 'corpus', 'image',)
search_fields = ('name', )
inlines = (MetaDataInline, ClassificationInline)
......
......@@ -329,7 +329,8 @@ class Image(S3FileMixin, IndexableModel):
self.width, self.height = new_width, new_height
def __str__(self):
return '{} - {}'.format(self.id, self.url)
# Used by admin
return self.url
class Thumbnail(S3FileMixin):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment