def _calculate_property_price(request):
    """
    Calculates the price of the currently selected properties.
    """
    property_price = 0
    for key, option_id in request.POST.items():
        if key.startswith("property"):
            try:
                property_group_id, property_id = map(int, key.split('-')[1:])
                prop = Property.objects.get(pk=property_id)
                if prop.is_select_field:
                    po = PropertyOption.objects.get(property=property, pk=option_id)
                    if prop.add_price:
                        po_price = float(po.price)
                        property_price += po_price
            except (__HOLE__, ValueError, TypeError, PropertyOption.DoesNotExist, Property.DoesNotExist):
                pass
    return property_price
dataset/ETHPy150Open diefenbach/django-lfs/lfs/catalog/views.py/_calculate_property_price