Models

The Data Warehouse is built from a number of separate modules. Each module is a separate Django “application” - i.e. it is integrated into the overall application using the INSTALLED_APPS Django setting. Each module consists of a models.py file that contains the Django Models for that component, and associated other files that contain other Django classes for processing the models (e.g. admin.py, serializers.py, viewsets.py, etc.).

The core modules are:

  • Common: various foundational metadata models, such as Country and Currency.

  • Spatial: metadata for managing spatial reference data such as Geographic Unit and the Geographic Unit Relationship links that create the spatial graph.

  • Warehouse: the foundational layer for all the specific Data Domains, which contains data structures and functionality that are inherited by the specific domains. Key models include Source Document, Data Series, Data Collection and Data Point.

There are also a number of specific domains that build on the Warehouse module to manage a specific type of data relevant to food security analysis:

  • IPC: data related to the Integrated Phase Classification (IPC) analysis of the food security situation, including the IPC Classification and IPC Population Size data series.

  • Price: data related to the analysis of market prices, including Market Product, Price Index, and Exchange Rate,.

  • Response: data related to humanitarian responses, such as flows of money or food aid.

  • Survey: data generally gathered through surveys, including Crop Production Indicator, Nutrition Indicator and Population Indicator data series.

  • Trade: data related to cross-border trade.

In addition to the KDW-specific code, there are a number of additional model classes provided by third party packages used by KDW, for example Users, Groups and Periodic Tasks.