Fix Search str
This commit is contained in:
parent
76f714a257
commit
1f52df987e
2 changed files with 11 additions and 1 deletions
10
app/admin.py
10
app/admin.py
|
@ -85,6 +85,16 @@ class PeaksAdmin(admin.ModelAdmin):
|
|||
|
||||
class SearchAdmin(admin.ModelAdmin):
|
||||
search_fields = ['search_string', 'search_date', 'result']
|
||||
list_display = ['search_string', 'search_date', 'result']
|
||||
|
||||
def search_string(self, obj):
|
||||
return str(obj.search_string) if obj else '--'
|
||||
|
||||
def search_date(self, obj):
|
||||
return str(obj.search_date) if obj else '--'
|
||||
|
||||
def result(self, obj):
|
||||
return str(obj.result) if obj else '--'
|
||||
|
||||
|
||||
class SpeciesAdmin(admin.ModelAdmin):
|
||||
|
|
|
@ -470,7 +470,7 @@ class Search(models.Model):
|
|||
stored = models.TextField(blank=True, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.range_name.name, self.repository
|
||||
return self.search_string if self else ' -- '
|
||||
|
||||
|
||||
class Person(models.Model):
|
||||
|
|
Loading…
Reference in a new issue