python - django feeds has wrong pub date -


i have following problem.

handlers.py of project's django-piston api:

.... # "need" set datetime.strftime() locale.setlocale(locale.lc_time,'de_at.utf-8')  class itemoverviewhandler(basehandler):     ...     @classmethod     def date(self, item):         # because of setlocale() call datestring in german         # that's         return item.somedatefield.date.strftime("%d. %b %y")  ... 

now seems effects project's feeds (created django.contrib.syndication):

def item_pubdate(self, item):     return item.pub_date #datetime field # rss look's # that's not <pubdate>die, 17 aug 2010 14:00:00 +0200</pubdate> 

(this rfc conform date, in german die == dienstag == tuesday), it's invalid.

so need piston api response in german (done). pubdate of feed has in english (have no idea how accomplish this).

any suggestions???

regards, klemens

this did trick. im still open other suggestions :)

class itemoverviewhandler(basehandler):     ...     @classmethod     def date(self, item):         locale.setlocale(locale.lc_time,'de_at.utf-8')         date_string = item.somedatefield.date.strftime("%d. %b %y")         locale.setlocale(locale.lc_time,'')         return date_string 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -