in app/helpers/orders/data_classes.py [0:0]
def deserialize(data):
"""
Helper function for parsing a dict of shipping data to a Shipping object.
Parameters:
data (dict): A dict of shipping data.
Output:
A Shipping object.
"""
if data:
return Shipping(
address_1=data.get('address_1'),
address_2=data.get('address_2'),
city=data.get('city'),
state=data.get('state'),
zip_code=data.get('zip_code'),
email=data.get('email'),
mobile=data.get('mobile')
)
return None