Home | History | Annotate | Download | only in samplesyncadapter_server

Lines Matching refs:contact

18 Defines Django forms for inserting/updating/viewing contact data
66 """Represents django form for entering contact info."""
69 model = datastore.Contact
74 Processes requests to add a new contact. GET presents an empty
75 contact form for the user to fill in. POST saves the new contact
80 self.send_form('Add Contact', '/add_contact', -1, None, ContactForm())
91 self.send_form('Add Contact', '/add_contact', -1, None, data)
96 Process requests to edit a contact's information. GET presents a form
97 with the current contact information filled in. POST saves new information
98 into the contact record.
103 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
104 self.send_form('Edit Contact', '/edit_contact', id, contact.handle,
105 ContactForm(instance=contact))
109 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
110 data = ContactForm(data=self.request.POST, instance=contact)
119 self.send_form('Edit Contact', '/edit_contact', id, contact.handle, data)
122 """Processes delete contact request."""
126 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
127 contact.deleted = True
128 contact.updated = datetime.datetime.utcnow()
129 contact.put()
135 Processes requests to edit contact's avatar. GET is used to fetch
136 a page that displays the contact's current avatar and allows the user
138 submit the form which will change the contact's avatar.
143 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
145 'avatar': contact.avatar,
154 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
157 contact.avatar = db.Blob(avatar)
158 contact.updated = datetime.datetime.utcnow()
159 contact.put()
164 Processes request to view contact's avatar. This is different from
171 contact = datastore.Contact.get(db.Key.from_path('Contact', id))
172 if (contact.avatar):
174 self.response.out.write(contact.avatar)
185 contacts = datastore.Contact.all()