本文整理汇总了Python中models.Transaction.create方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.create方法的具体用法?Python Transaction.create怎么用?Python Transaction.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Transaction
的用法示例。
在下文中一共展示了Transaction.create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_transaction
# 需要导入模块: from models import Transaction [as 别名]
# 或者: from models.Transaction import create [as 别名]
def create_transaction(client_id, recipient_number, amount):
try:
recipient = Bill.objects.get(number=recipient_number)
except:
return [recipient_number, amount]
trans = Transaction()
trans.create(client_id, recipient, amount)
return trans.code
示例2: save_transaction
# 需要导入模块: from models import Transaction [as 别名]
# 或者: from models.Transaction import create [as 别名]
def save_transaction(self, TRANSID, ACCOUNTID, TOACCOUNTID, PAYEEID, TRANSAMOUNT, TRANSCODE, STATUS, TRANSACTIONNUMBER, NOTES, CATEGID, SUBCATEGID, TRANSDATE, FOLLOWUPID, TOTRANSAMOUNT):
t = Transaction.create(TRANSID = TRANSID, ACCOUNTID=ACCOUNTID, TOACCOUNTID=TOACCOUNTID, PAYEEID=PAYEEID, TRANSAMOUNT=TRANSAMOUNT, TRANSCODE=TRANSCODE, STATUS=STATUS, TRANSACTIONNUMBER=TRANSACTIONNUMBER, NOTES=NOTES, CATEGID=CATEGID, SUBCATEGID=SUBCATEGID, TRANSDATE=TRANSDATE, FOLLOWUPID=FOLLOWUPID, TOTRANSAMOUNT=TOTRANSAMOUNT)
id = t.TRANSID
return id