diff --git a/django/contrib/syndication/views.py b/django/contrib/syndication/views.py
index 996b7df..a80b9d1 100644
a
|
b
|
class Feed(object):
|
184 | 184 | link = link, |
185 | 185 | description = description, |
186 | 186 | unique_id = self.__get_dynamic_attr('item_guid', item, link), |
| 187 | unique_id_is_permalink = self.__get_dynamic_attr( |
| 188 | 'item_guid_is_permalink', item), |
187 | 189 | enclosure = enc, |
188 | 190 | pubdate = pubdate, |
189 | 191 | author_name = author_name, |
diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
index f9126a6..cdb4769 100644
a
|
b
|
class SyndicationFeed(object):
|
113 | 113 | |
114 | 114 | def add_item(self, title, link, description, author_email=None, |
115 | 115 | author_name=None, author_link=None, pubdate=None, comments=None, |
116 | | unique_id=None, enclosure=None, categories=(), item_copyright=None, |
117 | | ttl=None, **kwargs): |
| 116 | unique_id=None, unique_id_is_permalink=None, enclosure=None, |
| 117 | categories=(), item_copyright=None, ttl=None, **kwargs): |
118 | 118 | """ |
119 | 119 | Adds an item to the feed. All args are expected to be Python Unicode |
120 | 120 | objects except pubdate, which is a datetime.datetime object, and |
… |
… |
class SyndicationFeed(object):
|
136 | 136 | 'pubdate': pubdate, |
137 | 137 | 'comments': to_unicode(comments), |
138 | 138 | 'unique_id': to_unicode(unique_id), |
| 139 | 'unique_id_is_permalink': unique_id_is_permalink, |
139 | 140 | 'enclosure': enclosure, |
140 | 141 | 'categories': categories or (), |
141 | 142 | 'item_copyright': to_unicode(item_copyright), |
… |
… |
class Rss201rev2Feed(RssFeed):
|
280 | 281 | if item['comments'] is not None: |
281 | 282 | handler.addQuickElement("comments", item['comments']) |
282 | 283 | if item['unique_id'] is not None: |
283 | | handler.addQuickElement("guid", item['unique_id']) |
| 284 | guid_attrs = {} |
| 285 | if isinstance(item.get('unique_id_is_permalink'), bool): |
| 286 | guid_attrs['isPermalink'] = str( |
| 287 | item['unique_id_is_permalink']).lower() |
| 288 | handler.addQuickElement("guid", item['unique_id'], guid_attrs) |
284 | 289 | if item['ttl'] is not None: |
285 | 290 | handler.addQuickElement("ttl", item['ttl']) |
286 | 291 | |
diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
index 2955d7d..1fbc718 100644
a
|
b
|
This example illustrates all possible attributes and methods for a
|
624 | 624 | Takes an item, as return by items(), and returns the item's ID. |
625 | 625 | """ |
626 | 626 | |
| 627 | # ITEM_GUID_IS_PERMALINK -- The following method is optional. If |
| 628 | # provided, it sets the 'isPermalink' attribute of an item's |
| 629 | # GUID element. This method is used only when 'item_guid' is |
| 630 | # specified. |
| 631 | |
| 632 | def item_guid_is_permalink(self, obj): |
| 633 | """ |
| 634 | Takes an item, as returned by items(), and returns a boolean. |
| 635 | """ |
| 636 | |
| 637 | item_guid_is_permalink = False # Hard coded value |
| 638 | |
627 | 639 | # ITEM AUTHOR NAME -- One of the following three is optional. The |
628 | 640 | # framework looks for them in this order. |
629 | 641 | |