當前位置: 首頁>>代碼示例>>Python>>正文


Python Workflow.reApplyWorkflow方法代碼示例

本文整理匯總了Python中workflow.workflow.Workflow.reApplyWorkflow方法的典型用法代碼示例。如果您正苦於以下問題:Python Workflow.reApplyWorkflow方法的具體用法?Python Workflow.reApplyWorkflow怎麽用?Python Workflow.reApplyWorkflow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在workflow.workflow.Workflow的用法示例。


在下文中一共展示了Workflow.reApplyWorkflow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: post

# 需要導入模塊: from workflow.workflow import Workflow [as 別名]
# 或者: from workflow.workflow.Workflow import reApplyWorkflow [as 別名]
 def post(self, request, *args, **kwargs):
         payment_id = request.POST.get('_submit')
         if payment_id:
             now = datetime.datetime.now()
             payment = Payment.objects.filter(payment_id = payment_id)[0]
             if not payment.is_applied:
                 payment.create_time = now
                 payment.is_applied = True
                 payment.save(update_fields=['create_time', 'is_applied'])
             
             route = Route.objects.filter(route_name = PAYMENT_APPLY, company = self.user.company)[0]
             
             document = Document.objects.get_or_create(document_id = payment_id, defaults = {'document_type':PAYMENT_TYPE,
                                                                                             'user':self.user,
                                                                                             'create_date':now})
             
             item = Item.objects.get_or_create(document = document[0],
                                                item_name = PAYMENT_APPLY,
                                                route = route,
                                                user = self.user)
             #重新發起申請
             if item[0].status == ITEM_REJECTED:
                 workflow = Workflow()
                 workflow.reApplyWorkflow(item[0], self.user, '')
             else:#新申請
                 workflow = Workflow()      
                 workflow.applyWorkflow(route, item[0], self.user)
             self.message_user(u"提交申請成功", 'success')
         return super(PaymentAdmin, self).post(request, *args, **kwargs)
開發者ID:mgrai,項目名稱:mmcp,代碼行數:31,代碼來源:adminx.py


注:本文中的workflow.workflow.Workflow.reApplyWorkflow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。