summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-06-19 01:38:06 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-06-19 01:38:06 +0000
commita93b1f7ac34c61ae4aa64423e9e46dc5d5349434 (patch)
tree43430945c79192ed32d893eaa6b87cdf89e9eb24 /docs
parentc0ea3284d705a5d66c8aff372a5e33b15dce56e7 (diff)
Fixed #1473 -- Added support for categories back into syndication feeds
(was accidently removed in r1994). Thanks, k.shaposhnikov@gmail.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@3143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/syndication_feeds.txt36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/syndication_feeds.txt b/docs/syndication_feeds.txt
index b7b0a9047b..4f77c4ff21 100644
--- a/docs/syndication_feeds.txt
+++ b/docs/syndication_feeds.txt
@@ -439,6 +439,23 @@ This example illustrates all possible attributes and methods for a ``Feed`` clas
author_link = 'http://www.example.com/' # Hard-coded author URL.
+ # CATEGORIES -- One of the following three is optional. The framework
+ # looks for them in this order. In each case, the method/attribute
+ # should return an iterable object that returns strings.
+
+ def categories(self, obj):
+ """
+ Takes the object returned by get_object() and returns the feed's
+ categories as iterable over strings.
+ """
+
+ def categories(self):
+ """
+ Returns the feed's categories as iterable over strings.
+ """
+
+ categories = ("python", "django") # Hard-coded list of categories.
+
# ITEMS -- One of the following three is required. The framework looks
# for them in this order.
@@ -602,6 +619,25 @@ This example illustrates all possible attributes and methods for a ``Feed`` clas
item_pubdate = datetime.datetime(2005, 5, 3) # Hard-coded pubdate.
+ # ITEM CATEGORIES -- It's optional to use one of these three. This is
+ # a hook that specifies how to get the list of categories for a given
+ # item. In each case, the method/attribute should return an iterable
+ # object that returns strings.
+
+ def item_categories(self, item):
+ """
+ Takes an item, as returned by items(), and returns the item's
+ categories.
+ """
+
+ def item_categories(self):
+ """
+ Returns the categories for every item in the feed.
+ """
+
+ item_categories = ("python", "django") # Hard-coded categories.
+
+
The low-level framework
=======================