Skip to content

Commit

Permalink
Merge pull request #578 from NASA-IMPACT/576-ej-data-api-endpoint
Browse files Browse the repository at this point in the history
EJ data API endpoint
  • Loading branch information
code-geek authored Feb 2, 2024
2 parents 1efa827 + b11fb41 commit 059f3c2
Show file tree
Hide file tree
Showing 10 changed files with 4,350 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Base settings to build other settings files upon.
"""

from pathlib import Path

import environ
Expand Down Expand Up @@ -90,7 +91,12 @@
"http://localhost:4200",
]

LOCAL_APPS = ["sde_indexing_helper.users", "sde_collections", "feedback"]
LOCAL_APPS = [
"environmental_justice",
"sde_indexing_helper.users",
"sde_collections",
"feedback",
]
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS

Expand Down
Empty file.
10 changes: 10 additions & 0 deletions environmental_justice/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.contrib import admin # noqa

from .models import EnvironmentalJusticeRow


@admin.register(EnvironmentalJusticeRow)
class EnvironmentalJusticeAdmin(admin.ModelAdmin):
"""Admin View for EnvironmentalJustice"""

list_display = ("dataset", "description")
6 changes: 6 additions & 0 deletions environmental_justice/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class EnvironmentalJusticeConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "environmental_justice"
4,226 changes: 4,226 additions & 0 deletions environmental_justice/fixtures/ej_row.json

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions environmental_justice/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generated by Django 5.0.1 on 2024-02-02 16:40

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="EnvironmentalJusticeRow",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("dataset", models.CharField(verbose_name="Dataset")),
("description", models.CharField(verbose_name="Description")),
(
"description_simplified",
models.CharField(verbose_name="Description Simplified"),
),
("indicators", models.CharField(verbose_name="Indicators")),
("intended_use", models.CharField(verbose_name="Intended Use")),
("latency", models.CharField(verbose_name="Latency")),
("limitations", models.CharField(verbose_name="Limitations")),
("project", models.CharField(verbose_name="Project")),
("source_link", models.CharField(verbose_name="Source Link")),
("strengths", models.CharField(verbose_name="Strengths")),
("format", models.CharField(verbose_name="Format")),
(
"geographic_coverage",
models.CharField(verbose_name="Geographic Coverage"),
),
(
"data_visualization",
models.CharField(verbose_name="Data Visualization"),
),
(
"spatial_resolution",
models.CharField(verbose_name="Spatial Resolution"),
),
("temporal_extent", models.CharField(verbose_name="Temporal Extent")),
(
"temporal_resolution",
models.CharField(verbose_name="Temporal Resolution"),
),
],
options={
"verbose_name": "Environmental Justice Row",
"verbose_name_plural": "Environmental Justice Rows",
},
),
]
Empty file.
33 changes: 33 additions & 0 deletions environmental_justice/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from django.db import models


class EnvironmentalJusticeRow(models.Model):
"""
Environmental Justice data from the spreadsheet
"""

dataset = models.CharField("Dataset")
description = models.CharField("Description")
description_simplified = models.CharField("Description Simplified")
indicators = models.CharField("Indicators")
intended_use = models.CharField("Intended Use")
latency = models.CharField("Latency")
limitations = models.CharField("Limitations")
project = models.CharField("Project")
source_link = models.CharField("Source Link")
strengths = models.CharField("Strengths")

# fields that needs cleaning
format = models.CharField("Format")
geographic_coverage = models.CharField("Geographic Coverage")
data_visualization = models.CharField("Data Visualization")
spatial_resolution = models.CharField("Spatial Resolution")
temporal_extent = models.CharField("Temporal Extent")
temporal_resolution = models.CharField("Temporal Resolution")

class Meta:
verbose_name = "Environmental Justice Row"
verbose_name_plural = "Environmental Justice Rows"

def __str__(self):
return self.dataset
3 changes: 3 additions & 0 deletions environmental_justice/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase # noqa

# Create your tests here.
3 changes: 3 additions & 0 deletions environmental_justice/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render # noqa

# Create your views here.

0 comments on commit 059f3c2

Please sign in to comment.