views:

100

answers:

1

Hi,

I have model

class info(db.Model):
    user = db.UserProperty()
    last_update_date = db.DateTimeProperty()

I need to retrieve last_update_date for specific user. It is working good, i can retrieve this value, i can even pass it to another variable

if results:
    for result in results:            
        data = result.last_update_date

Problem lies when i try to assign it to

feed_uri = contacts.GetFeedUri()
feed_query = gdata.contacts.service.ContactsQuery(feed_uri) 
feed_query.updated_min = data

This is done outside any loops so i do not see why it says that datetime is not iterable. Error message i receive is

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

Am i doing something wrong or is it a bug? Thank you for responses.

A: 

An example from the contacts API documentation:

updated_min = raw_input('Enter updated min (example: 2007-03-16T00:00:00): ')
query = gdata.contacts.service.ContactsQuery()
query.updated_min = updated_min

I think the updated_min property takes a string, not a datetime object.

lemnar