コード例 #1
0
 def get_job_object(self, pk):
     try:
         ds1 = dispatcher_status2.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()
         return ds1
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status='Stopped')
         ds1.id = 1
         ds1.save()
         return ds1
コード例 #2
0
ファイル: views.py プロジェクト: LarryHillyer/TexasHoldem
 def get_job_object(self, pk):
     try:
         ds1 = dispatcher_status2.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()           
         return ds1
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status = 'Stopped')
         ds1.id = 1
         ds1.save()
         return ds1
コード例 #3
0
 def set_object(self):
     try:
         ds1 = dispatcher_status2.objects.get(pk=1)
         if ds1.status != 'Reset':
             ds1.status = 'Reset'
             ds1.save()
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status='Reset')
         ds1.id = 1
         ds1.save()
     try:
         sj1 = analyzed_jobs.objects.get(status='running')
         sj1.status = 'aborted'
         sj1.save()
     except:
         pass
     return
コード例 #4
0
ファイル: views.py プロジェクト: LarryHillyer/TexasHoldem
 def set_object(self):
     try:
         ds1 = dispatcher_status2.objects.get(pk=1)
         if ds1.status != 'Reset':
             ds1.status = 'Reset'
             ds1.save()
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status = 'Reset')
         ds1.id = 1
         ds1.save()      
     try:
         sj1 = analyzed_jobs.objects.get(status='running')
         sj1.status ='aborted'
         sj1.save()
     except:
         pass
     return