def record(document_id, index): enable_cache() document = get_document(document_id) record = DocumentRecord.by_index(document.id, index) if record is None: raise NotFound("No such record: %s" % index) return jsonify(record, schema=RecordSchema)
def record(document_id, index): enable_cache() document = get_document(document_id) if not document.has_records(): raise BadRequest("This document does not have records.") record = DocumentRecord.by_index(document.id, index) if record is None: raise NotFound("No such record: %s" % index) return jsonify(record, schema=RecordSchema)
def record(document_id, index): enable_cache() document = get_db_document(document_id) if not document.supports_records: raise BadRequest("This document does not have records.") record = DocumentRecord.by_index(document.id, index) if record is None: raise NotFound("No such record: %s" % index) return serialize_data(record, RecordSchema)