示例#1
0
def create_office(business, addresses, office_type):
    office = Office()
    office.office_type = office_type
    office.addresses = addresses

    if business.offices is None:
        business.offices = []

    business.offices.append(office)
示例#2
0
def create_office(business: Business, addresses: list, office_type: str):
    """Create office and link it to business."""
    office = Office()
    office.office_type = office_type
    office.addresses = addresses

    if business.offices is None:
        business.offices = []

    business.offices.append(office)
示例#3
0
文件: __init__.py 项目: rarmitag/lear
def create_office(business, office_type, addresses) -> Office:
    """Create a new office for incorporation."""
    office = Office()
    office.office_type = office_type
    office.addresses = []
    # Iterate addresses and add to this office
    for k, v in addresses.items():
        address = create_address(v, k)
        address.business_id = business.id
        if address:
            office.addresses.append(address)
    return office