diff options
| author | Viktor Garske <git@v-gar.de> | 2020-07-23 16:42:25 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-30 07:36:27 +0200 |
| commit | 1173db4a16bb2938ba62a6cd50372a76a7f9e05f (patch) | |
| tree | 69f95aef9fbd7875f16238ba7ae0e62c3a0057aa /docs | |
| parent | 184a6eebb0ef56d5f1b1315a8e666830e37f3f81 (diff) | |
Fixed #31822 -- Added support for comments URL per feed item.
The item_comments hook returns a comments URL which is then used by the
feed builder.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/syndication.txt | 21 | ||||
| -rw-r--r-- | docs/releases/3.2.txt | 3 |
2 files changed, 23 insertions, 1 deletions
diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index 13aa944e8a..e9063d0629 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -889,6 +889,27 @@ This example illustrates all possible attributes and methods for a item_copyright = 'Copyright (c) 2007, Sally Smith' # Hard-coded copyright notice. + # ITEM COMMENTS URL -- It's optional to use one of these three. This is + # a hook that specifies how to get the URL of a page for comments for a + # given item. + + def item_comments(self, obj): + """ + Takes an item, as returned by items(), and returns the item's + comments URL as a normal Python string. + """ + + def item_comments(self): + """ + Returns the comments URL for every item in the feed. + """ + + item_comments = 'https://www.example.com/comments' # Hard-coded comments URL + +.. versionchanged:: 3.2 + + Support for a comments URL per feed item was added through the + ``item_comments`` hook. The low-level framework ======================= diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt index 129026cf89..ada68addea 100644 --- a/docs/releases/3.2.txt +++ b/docs/releases/3.2.txt @@ -144,7 +144,8 @@ Minor features :mod:`django.contrib.syndication` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* ... +* The new ``item_comments`` hook allows specifying a comments URL per feed + item. Cache ~~~~~ |
