class info(db.Model):
user = db.UserProperty()
last_update_date = db.DateTimeProperty()
我需要檢索last_update_date
針對特定用戶。它的工作好,我可以檢索此值,我甚至可以把它傳遞給另一個變量
if results:
for result in results:
data = result.last_update_date
問題在於當我試圖把它分配給
feed_uri = contacts.GetFeedUri()
feed_query = gdata.contacts.service.ContactsQuery(feed_uri)
feed_query.updated_min = data
這是任何循環之外完成的,所以我不明白爲什麼它說日期時間不可迭代。我收到 錯誤消息
Traceback (most recent call last): File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp__init__.py", line 507, in call handler.get(*groups) File "C:\Users\mklich\workspace\google_contacts_webapp\src\contacts-list.py", line 266, in get listc = checkUserPrivateContacts(user) File "C:\Users\mklich\workspace\google_contacts_webapp\src\contacts-list.py", line 189, in checkUserPrivateContacts feed = contacts.GetContactsFeed(feed_query.ToUri()) File "C:\Users\mklich\workspace\google_contacts_webapp\src\gdata\service.py", line 1718, in ToUri return atom.service.BuildUri(q_feed, self) File "C:\Users\mklich\workspace\google_contacts_webapp\src\atom\service.py", line 584, in BuildUri parameter_list = DictionaryToParamList(url_params, escape_params) File "C:\Users\mklich\workspace\google_contacts_webapp\src\atom\service.py", line 551, in DictionaryToParamList for param, value in (url_parameters or {}).items()] File "C:\Python25\lib\urllib.py", line 1210, in quote_plus if ' ' in s: TypeError: argument of type 'datetime.datetime' is not iterable
難道我做錯了什麼或者是一個錯誤嗎? 謝謝你的回覆。
您沒有在您的問題中包含導致異常的實際代碼,也沒有將生成參數的代碼傳遞給它。我們需要這個能夠診斷任何事情。 – 2009-10-30 14:12:04