def update_address_book(self, user, shipping_addr):
        try:
            user_addr = user.addresses.get(
                hash=shipping_addr.generate_hash())
        except ObjectDoesNotExist:
            # Create a new user address
            user_addr = UserAddress(user=user)
            shipping_addr.populate_alternative_model(user_addr)
        user_addr.num_orders += 1
        user_addr.save()
Update the user's address book based on the new shipping address
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/checkout/mixins.py/OrderPlacementMixin.update_address_book