Skip to content
Benjamin Schnabel edited this page Apr 15, 2021 · 1 revision

How do I fetch the GND-ID for the template?

Load the GND-Module

The module is called gnd.py.

Import it: from .gnd import fetch_gnd_id in views.py or where needed.

Add the file to the settings

The file is gzipped.

You need to add GND_FILE = "" to settings.py.

Our path is GND_FILE = "/data/judaicalink/data.judaicalink.org/htdocs/dumps/ep/ep_GND_ids.json.gz".

Usage

Call the function with: fetch_gnd_id(<ep-number>).

The function needs the entitiy-page-id (e.g. from the request).

It return the correct GND-ID if found. If the ID ist not found in the file, it returns None.

Clone this wiki locally