1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

Create first models

This commit is contained in:
Steffo 2021-04-05 01:29:27 +02:00
parent 7edcb21a15
commit c2cb1de7d9

View file

@ -1,3 +1,32 @@
from django.db import models
# Create your models here.
class DataSource(models.Model):
"""
A :class:`.DataSource` is a web service which provides access to statistical information sourced by multiple data
providers.
PandaSDMX supports natively multiple data sources, listed
`here <https://pandasdmx.readthedocs.io/en/v1.0/sources.html#data-sources>`_ .
They are duplicated in the database to allow for custom sources to be added through the :meth:`pandasdmx.add_source`
method.
"""
pandasdmx_id = models.CharField("Internal pandasdmx source id", max_length=16, primary_key=True)
builtin = models.BooleanField("If the source is builtin in pandasdmx")
name = models.CharField("Full name of the data source", max_length=512)
documentation_url = models.URLField("Documentation URL provided by the data source")
api_url = models.URLField("API URL where the statistical data can be requested")
class Project(models.Model):
"""
A research :class:`.Project` is a work which may use zero or more :class:`.DataSource`\\ s to prove or disprove an
hypothesis.
"""
name = models.CharField("Project name", max_length=512)
description = models.CharField("Project description", max_length=8192)
sources = models.ManyToManyField(DataSource, related_name="used_in")