本文整理匯總了Python中billy.models.transaction.TransactionModel.list_by_subscription_guid方法的典型用法代碼示例。如果您正苦於以下問題:Python TransactionModel.list_by_subscription_guid方法的具體用法?Python TransactionModel.list_by_subscription_guid怎麽用?Python TransactionModel.list_by_subscription_guid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類billy.models.transaction.TransactionModel
的用法示例。
在下文中一共展示了TransactionModel.list_by_subscription_guid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: subscription_transaction_list
# 需要導入模塊: from billy.models.transaction import TransactionModel [as 別名]
# 或者: from billy.models.transaction.TransactionModel import list_by_subscription_guid [as 別名]
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