Lines Matching full:contact
131 it returns user's contact info in JSON format.
139 logging.info('*** Starting contact sync ***')
149 # the newly added contact.
159 logging.info('Returning ' + str(len(updated_contacts)) + ' contact records')
184 contacts = datastore.Contact.all()
190 for contact in contacts:
191 if (contact.updated > high_water_date):
192 high_water_date = contact.updated
198 for contact in contacts:
200 # contact (for example, it's a contact just uploaded from the client)
202 if (self.list_contains_contact(updated_contacts, contact)):
205 handle = contact.handle
207 if timestamp is None or contact.updated > timestamp:
208 if contact.deleted == True:
223 # Build an array of generic objects containing contact data,
237 logging.info('Updating contact: ' + str(id))
238 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
240 logging.info('Creating new contact record')
242 contact = datastore.Contact(handle='temp')
244 # If the 'change' for this contact is that they were deleted
248 contact.deleted = True
249 contact.put()
250 logging.info('Deleted contact: ' + contact.handle)
253 contact.firstname = self.safe_attr(jcontact, 'f')
254 contact.lastname = self.safe_attr(jcontact, 'l')
255 contact.phone_home = self.safe_attr(jcontact, 'h')
256 contact.phone_office = self.safe_attr(jcontact, 'o')
257 contact.phone_mobile = self.safe_attr(jcontact, 'm')
258 contact.email = self.safe_attr(jcontact, 'e')
259 contact.deleted = (self.safe_attr(jcontact, 'd') == 'true')
263 contact.handle = contact.firstname + '_' + contact.lastname
264 logging.info('Created new contact handle: ' + contact.handle)
265 contact.put()
266 logging.info('Saved contact: ' + contact.handle)
270 # serialize out, so that the client can match this contact
275 # for this contact, so we return the correct value to the client.
276 high_water = str(long(_time.mktime(contact.updated.utctimetuple())) + 1)
280 # added contact)
282 UpdatedContactData(updated_contacts, contact.handle, client_id, base_url,
287 def list_contains_contact(self, contact_list, contact):
288 if (contact is None):
290 contact_id = str(contact.key().id())
303 Handles cron request to reset the contact database.
311 contacts = datastore.Contact.all()
312 for contact in contacts:
313 contact.delete()
316 contact1 = datastore.Contact(handle = 'juliet',
324 contact2 = datastore.Contact(handle = 'romeo',
332 contact3 = datastore.Contact(handle = 'tybalt',
365 obj = datastore.Contact.get_contact_info(username)
366 contact = {}
371 contact[json_name] = str(v)
373 contact[json_name] = None
374 contact['i'] = str(obj.key().id())
375 contact['a'] = host_url + "/avatar?id=" + str(obj.key().id())
376 contact['x'] = high_water_mark
378 contact['c'] = str(client_id)
379 contact_list.append(contact)
383 obj = datastore.Contact.get_contact_info(username)
384 contact = {}
385 contact['d'] = 'true'
386 contact['i'] = str(obj.key().id())
387 contact['x'] = high_water_mark
388 contact_list.append(contact)