*What steps will reproduce the problem?*

code attached to this post

*What is the expected output? What do you see instead?*

i want to add contact with all field defined in code.

when i tried to execute the code i received this error:

Traceback (most recent call last):
  File 
"/home/projects/google_appengine/google/appengine/ext/webapp/__init__.py", line 
515, in __call__
    handler.get(*groups)
  File "/home/projects/onlabs-erp/prova.py", line 72, in get
    contact_entry = client2.CreateContact(new_contact)
  File "/home/projects/onlabs-erp/gdata/contacts/client.py", line 110, in 
create_contact
    auth_token=auth_token,  **kwargs)
  File "/home/projects/onlabs-erp/gdata/client.py", line 685, in post
    desired_class=desired_class, **kwargs)
  File "/home/projects/onlabs-erp/gdata/client.py", line 265, in request
    uri=uri, auth_token=auth_token, http_request=http_request, **kwargs)
  File "/home/projects/onlabs-erp/atom/client.py", line 117, in request
    return self.http_client.request(http_request)
TypeError: request() takes at least 3 arguments (2 given)

*What version of the product are you using?*

2.0.14

*Please provide any additional information below.*

i received this error both with local appengine sdk and with code uploaded 

if i use n*ew_contact = gdata.contacts.ContactEntry() *with gdata v3.0 i'm 
unable to set up contact name or contact title

if i use n*ew_contact = gdata.contacts.ContactEntry() *with gdata v1.0 i'm 
unable to set up some fields such as birthday and user_defined_field

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html
import atom.url
import gdata.service
import gdata.alt.appengine
import gdata.contacts
import gdata.contacts.service
import gdata.contacts.data
import gdata.contacts.client
import gdata.auth
import gdata.data
import gdata.gauth

class MainPage(webapp.RequestHandler):

        def get(self):          
        
                #  Initialize a client to talk to Google Data API services.
                client = 
gdata.contacts.client.ContactsClient(additional_headers={gdata.contacts.service.GDATA_VER_HEADER:
 3})
                client.ClientLogin('[email protected]', 'password', 
'myappsource');

                gdata.alt.appengine.run_on_appengine(client)    
                
                new_contact = gdata.contacts.data.ContactEntry()
                new_contact.nickname = gdata.contacts.data.NickName(text="Full 
Name")
                new_contact.name = gdata.data.Name(
                    given_name=gdata.data.GivenName(text="Full Name"),
                    full_name=gdata.data.FullName(text="Nome"),
                    family_name=gdata.data.FamilyName(text="Cognome")
                )
                
new_contact.email.append(gdata.data.Email(address='[email protected]',primary='true',rel=gdata.contacts.REL_WORK))
                
new_contact.email.append(gdata.data.Email(address='[email protected]',primary='false',rel=gdata.contacts.REL_WORK))
                
new_contact.user_defined_field.append(gdata.contacts.data.UserDefinedField(key="chiave",value="valore"))
                new_contact.birthday = 
gdata.contacts.data.Birthday(when='2009-07-23')
        
                contact_entry = client.CreateContact(new_contact)       

Reply via email to