def export_proposals(request, *args, **kws): if request.method == 'POST': astrid = request.POST.get('astrid', 'false') == 'true' proposals = request.POST.getlist('proposals') DssExport(quiet = True).exportProposals(proposals) if astrid: astridDB = AstridDB(dbname = None, quiet = True) astridDB.addProjects(proposals) return HttpResponse(json.dumps({"success" : "ok"}) , content_type = 'application/json')
def export_semester(request, *args, **kws): if request.method == 'POST': astrid = request.POST.get('astrid', 'false') == 'true' semester = request.POST.get('semester') if semester is not None: proposals = [p.pcode for p in Proposal.objects.filter( semester__semester = semester) if p.allocatedTime() > 0] DssExport(quiet = True).exportProposals(proposals) if astrid: astridDB = AstridDB(dbname = None, quiet = True) astridDB.addProjects(proposals) return HttpResponse(json.dumps({"success" : "ok"}) , content_type = 'application/json')