billdeitrick / pypco

A Python client for the Planning Center Online API.
MIT License
39 stars 13 forks source link

The model is missing the "type" or "id" attribute and cannot be created. #21

Closed brandonmichaelhunter closed 4 years ago

brandonmichaelhunter commented 5 years ago

When I attempt to add a new address for a person who was just added, I get the following error: "The model is missing the "type" or "id" attribute and cannot be created."

Provided below is my code:

        pco = pypco.PCO(appID, appSecret)
        print("Logged into Planning Center")
        # Add a new family
        person = pco.new(pypco.models.people.Person)
        person.first_name = "Richard S"# emailLabelResults["Name"].split(' ')[0]
        person.last_name  = "HunGunter" #emailLabelResults["Name"].split(' ')[1]
        person.gender = "Male"
        person.birthdate = "1999-04-03"
        person.create()
        #TODO - figure out why using the pco.people.people.get throws an errorß
        address = pco.new(pypco.models.people.Address)
        address.city     = "Camelot"
        address.location = "Home"
        address.state    = "Pa"
        address.street   = "123 Round Table Rd"
        address.zip      = "12345"
        person.rel.addresses.add(address)
        person.update()

Any ideas?

billdeitrick commented 5 years ago

👋🏻Hi @brandonmichaelhunter! Sorry I wasn't able to be more responsive on this. Would you still like help with this, or did you get it figured out?

brandonmichaelhunter commented 4 years ago

@billdeitrick Yes I did. No worries. Thank you for responding.