(product_name, product_rate=None)
return {
        'name': product_rate.name,
        'rate_id': product_rate.id,
        'monthly_fee': str(product_rate.monthly_fee),
    }
This will be turned into a JSON representation of this SoftwareProductRate
This will be turned into a JSON representation of this SoftwareProductRate
This will be turned into a JSON representation of this SoftwareProductRate
def fmt_product_rate_dict(product_name, product_rate=None):
    """
    This will be turned into a JSON representation of this SoftwareProductRate
    """
    from corehq.apps.accounting.models import SoftwareProductRate

    if product_rate is None:
        try:
            product_rate = SoftwareProductRate.objects.filter(
                is_active=True,
                name=product_name,
            ).latest('date_created')
        except SoftwareProductRate.DoesNotExist:
            product_rate = SoftwareProductRate.objects.create(name=product_name, is_active=True)
    return {
        'name': product_rate.name,
        'rate_id': product_rate.id,
        'monthly_fee': str(product_rate.monthly_fee),
    }
def fmt_product_rate_dict ( product_name , product_rate = None ) : from corehq . apps . accounting . models import SoftwareProductRate if product_rate is None : try : product_rate = SoftwareProductRate . objects . filter ( is_active = True , name = product_name , ) . latest ( 'date_created' ) except SoftwareProductRate . DoesNotExist : product_rate = SoftwareProductRate . objects . create ( name = product_name , is_active = True ) return { 'name' : product_rate . name , 'rate_id' : product_rate . id , 'monthly_fee' : str ( product_rate . monthly_fee ) , }