diff --git a/odyseescraper/admin.py b/odyseescraper/admin.py index a5db70b..e165ba1 100644 --- a/odyseescraper/admin.py +++ b/odyseescraper/admin.py @@ -5,7 +5,7 @@ from .models import OdyseeChannel, OdyseeRelease, Tag # Register your models here. @admin.register(OdyseeChannel) class OdyseeChannelAdmin(admin.ModelAdmin): - list_display = ['name', 'handle', 'description', 'get_tags', 'id'] + list_display = ['name', 'handle', 'get_tags', 'description', 'id'] search_fields = ['name', 'description', 'handle'] ordering = ['name'] list_filter = ['tags'] diff --git a/odyseescraper/models.py b/odyseescraper/models.py index eaf2dd4..72cd7a6 100644 --- a/odyseescraper/models.py +++ b/odyseescraper/models.py @@ -35,3 +35,9 @@ class OdyseeRelease(models.Model): def __str__(self): return self.name + + @property + def all_tags(self): + self_tags = self.tags.all() + channel_tags = self.channel.tags.all() + return self_tags | channel_tags diff --git a/odyseescraper/templates/release_list.html b/odyseescraper/templates/release_list.html index e85d851..b993703 100644 --- a/odyseescraper/templates/release_list.html +++ b/odyseescraper/templates/release_list.html @@ -11,7 +11,7 @@
{{ release.channel.handle }}
{{ release.description }}