Renamed enclosure_url, enclosure_length and enclosure_mime_type to give them an 'item_' prefix, in the new RSS framework
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1141 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1847c9ef64
commit
0b1d24c54d
|
@ -14,7 +14,7 @@ class FeedDoesNotExist(ObjectDoesNotExist):
|
||||||
|
|
||||||
class Feed:
|
class Feed:
|
||||||
item_pubdate = None
|
item_pubdate = None
|
||||||
enclosure_url = None
|
item_enclosure_url = None
|
||||||
|
|
||||||
def item_link(self, item):
|
def item_link(self, item):
|
||||||
try:
|
try:
|
||||||
|
@ -67,12 +67,12 @@ class Feed:
|
||||||
for item in self.__get_dynamic_attr('items', obj):
|
for item in self.__get_dynamic_attr('items', obj):
|
||||||
link = add_domain(current_site.domain, self.__get_dynamic_attr('item_link', item))
|
link = add_domain(current_site.domain, self.__get_dynamic_attr('item_link', item))
|
||||||
enc = None
|
enc = None
|
||||||
enc_url = self.__get_dynamic_attr('enclosure_url', item)
|
enc_url = self.__get_dynamic_attr('item_enclosure_url', item)
|
||||||
if enc_url:
|
if enc_url:
|
||||||
enc = feedgenerator.Enclosure(
|
enc = feedgenerator.Enclosure(
|
||||||
url = enc_url.decode('utf-8'),
|
url = enc_url.decode('utf-8'),
|
||||||
length = str(self.__get_dynamic_attr('enclosure_length', item)).decode('utf-8'),
|
length = str(self.__get_dynamic_attr('item_enclosure_length', item)).decode('utf-8'),
|
||||||
mime_type = self.__get_dynamic_attr('enclosure_mime_type', item).decode('utf-8'),
|
mime_type = self.__get_dynamic_attr('item_enclosure_mime_type', item).decode('utf-8'),
|
||||||
)
|
)
|
||||||
feed.add_item(
|
feed.add_item(
|
||||||
title = title_template.render(Context({'obj': item, 'site': current_site})).decode('utf-8'),
|
title = title_template.render(Context({'obj': item, 'site': current_site})).decode('utf-8'),
|
||||||
|
|
Loading…
Reference in New Issue