(domain, product_id, location_type, case_id)
return None
Return the most specific consumption value for the passed
    parameters.
Return the most specific consumption value for the passed
    parameters.
Return the most specific consumption value for the passed parameters .
def get_default_monthly_consumption(domain, product_id, location_type, case_id):
    """
    Return the most specific consumption value for the passed
    parameters.
    """

    consumption = DefaultConsumption.objects.filter(
        domain=domain,
        product_id=product_id,
        supply_point_id=case_id
    ).first()

    if not consumption:
        consumption = DefaultConsumption.objects.filter(
            domain=domain,
            product_id=product_id,
            supply_point_type=location_type,
            supply_point_id=None
        ).first()

    if not consumption:
        consumption = DefaultConsumption.objects.filter(
            domain=domain,
            product_id=product_id,
            supply_point_type=None,
            supply_point_id=None
        ).first()

    if not consumption:
        consumption = DefaultConsumption.objects.filter(
            domain=domain,
            product_id=None,
            supply_point_type=None,
            supply_point_id=None
        ).first()

    if consumption:
        return consumption.default_consumption

    return None
def get_default_monthly_consumption ( domain , product_id , location_type , case_id ) : consumption = DefaultConsumption . objects . filter ( domain = domain , product_id = product_id , supply_point_id = case_id ) . first ( ) if not consumption : consumption = DefaultConsumption . objects . filter ( domain = domain , product_id = product_id , supply_point_type = location_type , supply_point_id = None ) . first ( ) if not consumption : consumption = DefaultConsumption . objects . filter ( domain = domain , product_id = product_id , supply_point_type = None , supply_point_id = None ) . first ( ) if not consumption : consumption = DefaultConsumption . objects . filter ( domain = domain , product_id = None , supply_point_type = None , supply_point_id = None ) . first ( ) if consumption : return consumption . default_consumption return None