コード例 #1
0
    def _save_potential(self, user=None, contact=None, potential=None):
        if contact['id'] is None or '' == contact['id']:
            c = Contact()
        else:
            c = Contact.objects.get(id=contact['id'])
        c.name = contact['name']
        c.title = contact['title']
        c.tel = contact['tel']
        c.mobile = contact['mobile']
        c.idCard = contact['idCard']
        c.email = contact['email']
        c.idCopy = contact['idCopy']
        # print(c.__dict__)
        c.save()

        if potential['id'] is None or '' == potential['id']:
            p = Potential()
        else:
            p = Potential.objects.get(id=potential['id'])
        p.zh_name = potential['zh_name']
        p.en_name = potential['en_name']
        p.ceo = potential['ceo']
        p.scope = potential['scope']
        p.founding = potential['founding']
        p.capital = potential['capital']
        p.licence = potential['licence']
        p.licenceCopy = potential['licenceCopy']
        p.tax = potential['tax']
        p.taxCopy = potential['taxCopy']
        p.orgCode = potential['orgCode']
        p.orgCodeCopy = potential['orgCodeCopy']
        p.employees = potential['employees']
        p.address = potential['address']
        p.homepage = potential['homepage']
        p.tel = potential['tel']
        p.fax = potential['fax']
        p.post = potential['post']
        p.summary = potential['summary']
        p.is_active = False
        p.contact = c
        p.user = user
        # print(p.__dict__)
        p.save()

        return p