コード例 #1
0
ファイル: views.py プロジェクト: MDrollette/billy
def subscription_transaction_list(request):
    """Get and return transactions of subscription

    """
    company = auth_api_key(request)

    offset = int(request.params.get('offset', 0))
    limit = int(request.params.get('limit', 20))
    guid = request.matchdict['subscription_guid']

    tx_model = TransactionModel(request.session)
    subscription = get_and_check_subscription(request, company, guid)

    transactions = tx_model.list_by_subscription_guid(
        subscription_guid=subscription.guid,
        offset=offset,
        limit=limit,
    )
    result = dict(
        items=list(transactions),
        offset=offset,
        limit=limit,
    )
    return result
コード例 #2
0
def subscription_transaction_list(request):
    """Get and return transactions of subscription

    """
    company = auth_api_key(request)

    offset = int(request.params.get('offset', 0))
    limit = int(request.params.get('limit', 20))
    guid = request.matchdict['subscription_guid']

    tx_model = TransactionModel(request.session)
    subscription = get_and_check_subscription(request, company, guid)

    transactions = tx_model.list_by_subscription_guid(
        subscription_guid=subscription.guid,
        offset=offset,
        limit=limit,
    )
    result = dict(
        items=list(transactions),
        offset=offset,
        limit=limit,
    )
    return result