def update(self,cspOrderItems=[]):
        dao = CspOrderDao()

        values = [(co.id,co.csp_id,co.csp_accounts_payable_contact_id,co.owner_id,co.owner_contact_id,co.owner_invoice_number,co.owner_invoice_date) for co in cspOrderItems]

        dao.update(values)

        ids = [(co.id) for co in cspOrderItems]
        updatedCspOrders = self.get(ids)
        return updatedCspOrders
    def get(self,ids=[]):
        dao = CspOrderDao()
        rows = dao.get(ids)
        cspOrders = []
        for row in rows:
            cspOrders.append(CspOrder(row[0],row[1],row[2],row[3],row[4],row[5],row[6]))

        self.decorate(cspOrders)

        return cspOrders
    def insert(self,cspOrderItems=[]):
        dao = CspOrderDao()

        values = [(co.csp_id,co.csp_accounts_payable_contact_id,co.owner_id,co.owner_contact_id,co.owner_invoice_number,co.owner_invoice_date) for co in cspOrderItems]

        ids = dao.insert(values)

        newCspOrders = self.get(ids)

        #set the default phone and email types
        return newCspOrders
 def addOrderItem(self,co,oi):
     dao = CspOrderDao()
     dao.joinOrderItem(co.id,oi.id)
     co.items.append(oi)
     return (self.get([co.id]))