Пример #1
0
Файл: ajax.py Проект: pannal/XDM
 def getDownload(self, id):
     download = Download.get(Download.id == id)
     tasks.snatchOne(download.element, [download])
     download = Download.get(Download.id == id)
     if download.status == common.SNATCHED:
         return json.dumps({'result': True, 'data': {'element_id': download.element.id, 'status_id': download.status.id}, 'msg': u'%s was snatched' % (download.name)})
     else:
         return json.dumps({'result': False, 'data': [], 'msg': u'%s not was snatched' % (download.name)})
Пример #2
0
 def getDownload(self, id):
     download = Download.get(Download.id == id)
     tasks.snatchOne(download.element, [download])
     download = Download.get(Download.id == id)
     if download.status == common.SNATCHED:
         return json.dumps({'result': True, 'data': {'element_id': download.element.id, 'status_id': download.status.id}, 'msg': u'%s was snatched' % (download.name)})
     else:
         return json.dumps({'result': False, 'data': [], 'msg': u'%s not was snatched' % (download.name)})
Пример #3
0
 def getDownload(self, id):
     download = Download.get(Download.id == id)
     tasks.snatchOne(download.element, [download])
     self.redirect('/')
Пример #4
0
 def getDownload(self, id):
     download = Download.get(Download.id == id)
     tasks.snatchOne(download.element, [download])
     self.redirect('/')