次の問題があります。
プロジェクトの django-piston api の handlers.py:
....
# "need" to set this for datetime.strftime()
locale.setlocale(locale.LC_TIME,'de_AT.UTF-8')
class ItemOverviewHandler(BaseHandler):
...
@classmethod
def date(self, item):
# because of the setlocale() call the datestring is in german
# that's good
return item.somedatefield.date.strftime("%d. %B %Y")
...
これはプロジェクトのフィード (django.contrib.syndication で作成) に影響するようです:
def item_pubdate(self, item):
return item.pub_date #datetime field
# the rss look's like this
# that's not good
<pubDate>Die, 17 Aug 2010 14:00:00 +0200</pubDate>
(これは rfc 準拠の日付ですが、ドイツ語では Die == Dienstag == 火曜日)、したがって無効です。
したがって、ピストン API の応答をドイツ語にする必要があります (完了)。しかし、フィードの pubDate は英語でなければなりません (これを達成する方法がわかりません)。
助言がありますか?