[Feature] Async Prediction Status Poll (#93)

Fixed #81

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#93
This commit is contained in:
2025-09-09 20:39:26 +12:00
parent 5477b5b3d4
commit 3453a169e1
3 changed files with 68 additions and 8 deletions

View File

@ -1438,6 +1438,12 @@ def package_pathway(request, package_uuid, pathway_uuid):
if request.GET.get("last_modified", False):
return JsonResponse({'modified': current_pathway.modified.strftime('%Y-%m-%d %H:%M:%S')})
if request.GET.get('status', False):
return JsonResponse({
'status': current_pathway.status(),
'modified': current_pathway.modified.strftime('%Y-%m-%d %H:%M:%S'),
})
if request.GET.get("download", False) == "true":
filename = f"{current_pathway.name.replace(' ', '_')}_{current_pathway.uuid}.csv"
csv_pw = current_pathway.to_csv()