本文整理汇总了Python中project.model.Project.get_entry_updated方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_entry_updated方法的具体用法?Python Project.get_entry_updated怎么用?Python Project.get_entry_updated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project.model.Project
的用法示例。
在下文中一共展示了Project.get_entry_updated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: export_worker
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import get_entry_updated [as 别名]
def export_worker(msg):
project = Project()
project.get(msg['project_id'])
completed = project.export_completed(msg['entry_id'],msg['format'])
file_id = ''
if completed:
print 'task completed, making sure file need to regenerated'
metadata = project.get_exported_file(msg['entry_id'],msg['format'])
if metadata['file_id']:
f = project.get_datafile(metadata['file_id'])
uploaded_date = f.upload_date
last_updated = project.get_entry_updated()
print uploaded_date
print last_updated
if last_updated > uploaded_date:
print 'file need regen'
task = export_single.delay(msg['project_id'],msg['entry_id'],msg['format'])
print task
project.set_exporter_task(msg['entry_id'],msg['format'],task.id)
completed = project.export_completed(msg['entry_id'],msg['format'])
else:
task = export_single.delay(msg['project_id'],msg['entry_id'],msg['format'])
project.set_exporter_task(msg['entry_id'],msg['format'],task.id)
completed = project.export_completed(msg['entry_id'],msg['format'])
while not completed:
completed = project.export_completed(msg['entry_id'],msg['format'])
yield {'completed':False,'file_id':file_id,'format':msg['format'],
'project_id':msg['project_id'],'entry_id':msg['entry_id']}
time.sleep(1)
project.get(msg['project_id'])
metadata = project.get_exported_file(msg['entry_id'],msg['format'])
print metadata['file_id']
f = project.get_datafile(metadata['file_id'])
file_id = metadata['file_id']
yield {'completed':True,'file_id':file_id,'format':msg['format'],
'project_id':msg['project_id'],'entry_id':msg['entry_id']}