def factory(request): request.validated['monitoring_src'] = {} root = Root(request) if not request.matchdict or not request.matchdict.get('monitoring_id'): return root request.validated['monitoring_id'] = request.matchdict['monitoring_id'] request.monitoring.__parent__ = root request.validated['monitoring'] = request.validated[ 'db_doc'] = request.monitoring if request.method != 'GET': request.validated['monitoring_src'] = request.monitoring.serialize( 'plain') if 'decision' in request.path.split('/'): return decision_factory(request) if 'cancellation' in request.path.split('/'): return cancellation_factory(request) elif 'conclusion' in request.path.split('/'): return conclusion_factory(request) elif 'eliminationReport' in request.path.split('/'): return elimination_factory(request) elif 'eliminationResolution' in request.path.split('/'): return elimination_resolution_factory(request) elif 'appeal' in request.path.split('/'): return appeal_factory(request) elif request.matchdict.get('post_id'): return post_factory(request) elif request.matchdict.get('party_id'): return get_item(request.monitoring, 'party', request) elif request.matchdict.get('document_id'): return get_item(request.monitoring, 'document', request) return request.monitoring
def elimination_factory(request): if request.matchdict.get('document_id'): return get_item(request.monitoring.eliminationReport, 'document', request) if request.method == "PUT": return request.monitoring else: return request.monitoring.eliminationReport
def factory(request): request.validated["request_src"] = {} root = Root(request) if not request.matchdict or not request.matchdict.get("request_id"): return root request.validated["request_id"] = request.matchdict["request_id"] request.request.__parent__ = root request.validated["request"] = request.validated[ "db_doc"] = request.request if request.method != "GET": request.validated["request_src"] = request.request.serialize("plain") if request.matchdict.get("document_id"): return get_item(request.request, "document", request) return request.request
def factory(request): request.validated['inspection_src'] = {} root = Root(request) if not request.matchdict or not request.matchdict.get('inspection_id'): return root request.validated['inspection_id'] = request.matchdict['inspection_id'] request.inspection.__parent__ = root request.validated['inspection'] = request.validated[ 'db_doc'] = request.inspection if request.method != 'GET': request.validated['inspection_src'] = request.inspection.serialize( 'plain') if request.matchdict.get('document_id'): return get_item(request.inspection, 'document', request) return request.inspection
def decision_factory(request): if request.matchdict.get('document_id'): return get_item(request.monitoring.decision, 'document', request) return request.monitoring.decision
def post_factory(request): post = get_item(request.monitoring, 'post', request) if request.matchdict.get('document_id'): return get_item(post, 'document', request) return post
def elimination_resolution_factory(request): if request.matchdict.get('document_id'): return get_item(request.monitoring.eliminationResolution, 'document', request) return request.monitoring.eliminationResolution
def appeal_factory(request): if request.monitoring.appeal: if request.matchdict.get('document_id'): return get_item(request.monitoring.appeal, 'document', request) return request.monitoring.appeal return request.monitoring
def liability_factory(request): liability = get_item(request.monitoring, 'liability', request) if request.matchdict.get('document_id'): return get_item(liability, 'document', request) return liability