feed: Add basic rss feed

This commit is contained in:
2024-04-14 16:48:07 +02:00
parent 3fec80f5a7
commit 1e60a14a81
3 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
from django.contrib.syndication.views import Feed
from django.urls import reverse
from .models import AdoptionNotice
class LatestAdoptionNoticesFeed(Feed):
title = "Nptfellchen"
link = "/rss/"
description = "Updates zu neuen Vermittlungen."
def items(self):
return AdoptionNotice.objects.order_by("-created_at")[:5]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.description