From 6e1a6fc3fa8b3147d3d2269ecb97f2eb9cff0ea8 Mon Sep 17 00:00:00 2001 From: Koen Bolhuis Date: Thu, 11 Oct 2018 14:10:19 +0200 Subject: [PATCH] Show correct type --- backend/postings/models.py | 6 ++++++ backend/postings/templates/postings/frontend/results.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/postings/models.py b/backend/postings/models.py index cf9fd89..0054bed 100644 --- a/backend/postings/models.py +++ b/backend/postings/models.py @@ -44,6 +44,12 @@ class RateableEntity(models.Model): def __str__(self): return self.name + def getType(self): + for (t, t_name) in RateableEntity.TYPE_CHOICES: + if t == self.entity_type: + return t_name + return '' + # A review represents any single data entry to the database. class Review(models.Model): # An integer rating in the domain [1, 5] diff --git a/backend/postings/templates/postings/frontend/results.html b/backend/postings/templates/postings/frontend/results.html index 6649fee..7140c62 100644 --- a/backend/postings/templates/postings/frontend/results.html +++ b/backend/postings/templates/postings/frontend/results.html @@ -10,7 +10,7 @@
-

+

"{{ search_query }}"

@@ -33,7 +33,7 @@