示例#1
0
 def _create_marcxml_record(obj, eng):
     from inspire.dojson.hepnames import hepnames2marc
     from inspire.dojson.utils import legacy_export_as_marc
     obj.extra_data["marcxml"] = legacy_export_as_marc(
         hepnames2marc.do(obj.data)
     )
     obj.log.info("Produced MarcXML: \n {}".format(
         obj.extra_data["marcxml"])
     )
示例#2
0
文件: views.py 项目: jma/inspire-next
def marcxml_filter(record):
    from inspire.dojson.hep import hep2marc
    from inspire.dojson.hepnames import hepnames2marc
    from inspire.dojson.utils import legacy_export_as_marc

    collections = [collection["primary"] for collection in record["collections"]]

    if "HEP" in collections:
        return legacy_export_as_marc(hep2marc.do(record))
    elif "HEPNAMES" in collections:
        return legacy_export_as_marc(hepnames2marc.do(record))