Changeset 5251
- Timestamp:
- 05/15/07 13:11:15 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/unicode/django/contrib/syndication/feeds.py
r5054 r5251 3 3 from django.contrib.sites.models import Site 4 4 from django.utils import feedgenerator 5 from django.utils.encoding import smart_unicode 5 6 from django.conf import settings 6 7 7 8 def add_domain(domain, url): 8 9 if not url.startswith('http://'): 10 # 'url' must already be ASCII and URL-quoted, so no need for encodign 11 # conversions here. 9 12 url = u'http://%s%s' % (domain, url) 10 13 return url … … 98 101 if enc_url: 99 102 enc = feedgenerator.Enclosure( 100 url = enc_url.decode('utf-8'),101 length = s tr(self.__get_dynamic_attr('item_enclosure_length', item)).decode('utf-8'),102 mime_type = s elf.__get_dynamic_attr('item_enclosure_mime_type', item).decode('utf-8'),103 url = smart_unicode(enc_url), 104 length = smart_unicode(self.__get_dynamic_attr('item_enclosure_length', item)), 105 mime_type = smart_unicode(self.__get_dynamic_attr('item_enclosure_mime_type', item)) 103 106 ) 104 107 author_name = self.__get_dynamic_attr('item_author_name', item) … … 109 112 author_email = author_link = None 110 113 feed.add_item( 111 title = title_tmp.render(Context({'obj': item, 'site': current_site})) .decode('utf-8'),114 title = title_tmp.render(Context({'obj': item, 'site': current_site})), 112 115 link = link, 113 description = description_tmp.render(Context({'obj': item, 'site': current_site})) .decode('utf-8'),116 description = description_tmp.render(Context({'obj': item, 'site': current_site})), 114 117 unique_id = link, 115 118 enclosure = enc, django/branches/unicode/django/utils/feedgenerator.py
r5054 r5251 35 35 tag = re.sub('/', ',%s:/' % date.strftime('%Y-%m-%d'), tag, 1) 36 36 tag = re.sub('#', '/', tag) 37 return 'tag:' + tag37 return u'tag:' + tag 38 38 39 39 class SyndicationFeed(object):
