diff --git a/app/db.sqlite3 b/app/db.sqlite3 index 0deb6124..c616941c 100644 Binary files a/app/db.sqlite3 and b/app/db.sqlite3 differ diff --git a/app/server/models.py b/app/server/models.py index 62fb2f37..5db9353c 100644 --- a/app/server/models.py +++ b/app/server/models.py @@ -2,6 +2,7 @@ import string from django.core.exceptions import ValidationError from django.db import models from django.contrib.auth.models import User +from django.contrib.staticfiles.storage import staticfiles_storage class Project(models.Model): @@ -26,6 +27,17 @@ class Project(models.Model): def is_type_of(self, project_type): return project_type == self.project_type + @property + def image(self): + if self.is_type_of(self.DOCUMENT_CLASSIFICATION): + url = staticfiles_storage.url('images/cat-1045782_640.jpg') + elif self.is_type_of(self.SEQUENCE_LABELING): + url = staticfiles_storage.url('images/cat-3449999_640.jpg') + elif self.is_type_of(self.Seq2seq): + url = staticfiles_storage.url('images/tiger-768574_640.jpg') + + return url + def __str__(self): return self.name diff --git a/app/server/static/images/cat-1045782_640.jpg b/app/server/static/images/cat-1045782_640.jpg new file mode 100644 index 00000000..d191bb27 Binary files /dev/null and b/app/server/static/images/cat-1045782_640.jpg differ diff --git a/app/server/static/images/cat-3449999_640.jpg b/app/server/static/images/cat-3449999_640.jpg new file mode 100644 index 00000000..5acaeddb Binary files /dev/null and b/app/server/static/images/cat-3449999_640.jpg differ diff --git a/app/server/static/images/tiger-768574_640.jpg b/app/server/static/images/tiger-768574_640.jpg new file mode 100644 index 00000000..30a6d68c Binary files /dev/null and b/app/server/static/images/tiger-768574_640.jpg differ diff --git a/app/server/templates/projects.html b/app/server/templates/projects.html index 1c6bfabd..a4217ff3 100644 --- a/app/server/templates/projects.html +++ b/app/server/templates/projects.html @@ -53,7 +53,7 @@
- Placeholder image + Placeholder image