Skip to content

Commit

Permalink
docs: TUP-706 feed status (ineffectual)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Sep 10, 2024
1 parent 4f9888b commit bd3397d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions apps/djangocms_blog_customizations/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
from djangocms_blog.settings import get_setting
from djangocms_blog.cms_appconfig import BlogConfig

import logging

logger = logging.getLogger(f"portal.{__name__}")

# XXX: This file is loaded, but it does NOT override the feed
# XXX: Logging via logger fails anywhere; via print fails inside any method
class LatestEntriesFeed(DjangoCMSBlogLatestEntriesFeed):
feed_type = Rss201rev2Feed
feed_items_number = get_setting("FEED_LATEST_ITEMS")

link = "/blog/"
print(f"CUSTOM FEED | FEED_LATEST_ITEMS: {feed_items_number}")

def __call__(self, request, *args, **kwargs):
namespace = get_setting("AUTO_NAMESPACE")
Expand All @@ -22,11 +20,13 @@ def __call__(self, request, *args, **kwargs):
self.namespace = get_setting("AUTO_NAMESPACE")
self.config = BlogConfig.objects.get(namespace=namespace)

logger.debug(f"CUSTOM FEED | NAMESPACE: {self.namespace}, CONFIG: {self.config}")
print(f"CUSTOM FEED | NAMESPACE: {self.namespace}, CONFIG: {self.config}")

return super().__call__(request, *args, **kwargs)

def items(self):
items = super().items()
logging.debug(f"CUSTOM FEED | FEED ITEMS: {items}")

print(f"CUSTOM FEED | FEED ITEMS: {items}")

return items
3 changes: 2 additions & 1 deletion apps/djangocms_blog_customizations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
urlpatterns = [
# To render styled Blog feed
# XXX: Does NOT style the feed
# XXX: Does NOT render items within the feed
# XXX: Does NOT customize the feed
# FAQ: See feed root at `/news/feed/`, items at `/news/feed/fb`
re_path(r'^feed/', LatestEntriesFeed(), name='feed'),

# To render current blog, content only (no Core-CMS base.html)
Expand Down

0 comments on commit bd3397d

Please sign in to comment.