Remove duplication on content page feed
This commit is contained in:
parent
c2150b66f3
commit
bc9bdce31d
1 changed files with 1 additions and 13 deletions
|
@ -82,28 +82,16 @@ class AllPagesFeed(Feed):
|
||||||
return item.last_published_at
|
return item.last_published_at
|
||||||
|
|
||||||
|
|
||||||
class ContentPageFeed(Feed):
|
class ContentPageFeed(AllPagesFeed):
|
||||||
def __init__(self, posts: PageQuerySet, link: str, title: str):
|
def __init__(self, posts: PageQuerySet, link: str, title: str):
|
||||||
self.posts = posts
|
self.posts = posts
|
||||||
self.link = link
|
self.link = link
|
||||||
self.title = title
|
self.title = title
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def __call__(
|
|
||||||
self, request: HttpRequest, *args: list, **kwargs: dict
|
|
||||||
) -> HttpResponse:
|
|
||||||
self.request = request
|
|
||||||
return super().__call__(request, *args, **kwargs)
|
|
||||||
|
|
||||||
def items(self) -> PageQuerySet:
|
def items(self) -> PageQuerySet:
|
||||||
return self.posts
|
return self.posts
|
||||||
|
|
||||||
def item_title(self, item: BaseContentPage) -> str:
|
|
||||||
return item.title
|
|
||||||
|
|
||||||
def item_link(self, item: BaseContentPage) -> str:
|
|
||||||
return item.get_full_url(request=self.request)
|
|
||||||
|
|
||||||
def item_description(self, item: BaseContentPage) -> str:
|
def item_description(self, item: BaseContentPage) -> str:
|
||||||
return item.summary
|
return item.summary
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue