Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link dataset to consideration on design.planning #267

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions application/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class DatasetModel(DigitalLandDateFieldsModel):
attribution_text: str = None
licence: str = None
licence_text: str = None
consideration: str = None


class TypologyModel(DigitalLandDateFieldsModel):
Expand Down
1 change: 1 addition & 0 deletions application/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class DatasetOrm(Base):
themes = Column(ARRAY(Text), nullable=True)
attribution_id = Column(Text, nullable=True)
licence_id = Column(Text, nullable=True)
consideration = Column(Text, nullable=True)

_attribution = relationship(
"AttributionOrm",
Expand Down
14 changes: 14 additions & 0 deletions application/templates/dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@ <h2 class="govuk-heading-s govuk-!-margin-bottom-0" id="specification">
</li>
</ul>
</nav>
{% if dataset['consideration'] %}
<hr class="govuk-section-break govuk-section-break--m">
<h2 class="govuk-heading-s govuk-!-margin-bottom-0" id="data-design">
Designing the data
</h2>
<p class="govuk-hint govuk-!-font-size-14">You can see details about how this dataset has been designed for planning.data.gov.uk</p>
<nav role="navigation" aria-labelledby="specification">
<ul class="govuk-list govuk-!-font-size-16">
<li>
<a class="govuk-link" href="https://design.planning.data.gov.uk/planning-consideration/{{ dataset['consideration'] }}">{{ dataset['consideration'] }} planning consideration</a>
</li>
</ul>
</nav>
{% endif %}
</aside>

</div>
Expand Down
25 changes: 25 additions & 0 deletions migrations/versions/180800810b09_add_consideration_to_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""add consideration to dataset

Revision ID: 180800810b09
Revises: f9c99b89b3c1
Create Date: 2024-06-26 13:46:25.381348

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "180800810b09"
down_revision = "f9c99b89b3c1"
branch_labels = None
depends_on = None


def upgrade():
op.add_column("dataset", sa.Column("consideration", sa.Text, nullable=True))


def downgrade():
op.drop_column("dataset", "consideration")
14 changes: 7 additions & 7 deletions tests/test_data/datasets.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dataset|name|entry_date|start_date|end_date|collection|description|key_field|paint_options|plural|prefix|text|typology|wikidata|wikipedia|themes|attribution|licence
greenspace|Greenspace|2022-01-07|||greenspace|Greenspace||"{ ""colour"": ""#78AA00"" }"|Greenspaces||# This is some markdown that will render in the dataset page |geography|Q1234567|Greenspace_(United_Kingdom)|heritage|crown-copyright|ogl3
forest|Forest|2022-01-07|||forest|Forest||"{ ""colour"": ""#85994b"" }"|Forests|||geography|Q7654321|Forest_(United_Kingdom)|environment,heritage|crown-copyright|ogl3
brownfield-site|Brownfield site|2022-01-07|||brownfield-site|Brownfield site||"{ ""colour"": ""#85994b"" }"|Brownfield sites|||geography|Q111222|Brownfield_site_(United_Kingdom)|environment,housing|crown-copyright|ogl3
historical-monument|Historical monument|2022-01-07|||historical-monument|Historical monument||"{ ""colour"": ""#85994b"" }"|Historical monuments|||geography|Q333444|Historical_monument_(United_Kingdom)|heritage|crown-copyright|ogl3
tree|Tree|2021-12-27|||tree-preservation-order|"An individual tree"||"{ ""colour"": ""#3B453D"", ""type"": ""point"" }"|Trees|||geography|Q10884|Tree|environment|crown-copyright|ogl3
conservation-area|Conservation area|2022-06-06|||conservation-area|Special architectural or historic interest, the character or appearance of which it is desirable to preserve or enhance||"{ ""colour"": ""#78AA00"" }"|Conservation areas|||geography|Q5162904|Conservation_area_(United_Kingdom)|heritage|crown-copyright|ogl3
dataset|name|entry_date|start_date|end_date|collection|description|key_field|paint_options|plural|prefix|text|typology|wikidata|wikipedia|themes|attribution|licence|consideration
greenspace|Greenspace|2022-01-07|||greenspace|Greenspace||"{ ""colour"": ""#78AA00"" }"|Greenspaces||# This is some markdown that will render in the dataset page |geography|Q1234567|Greenspace_(United_Kingdom)|heritage|crown-copyright|ogl3|greenspace
forest|Forest|2022-01-07|||forest|Forest||"{ ""colour"": ""#85994b"" }"|Forests|||geography|Q7654321|Forest_(United_Kingdom)|environment,heritage|crown-copyright|ogl3|forest
brownfield-site|Brownfield site|2022-01-07|||brownfield-site|Brownfield site||"{ ""colour"": ""#85994b"" }"|Brownfield sites|||geography|Q111222|Brownfield_site_(United_Kingdom)|environment,housing|crown-copyright|ogl3|brownfield-land
historical-monument|Historical monument|2022-01-07|||historical-monument|Historical monument||"{ ""colour"": ""#85994b"" }"|Historical monuments|||geography|Q333444|Historical_monument_(United_Kingdom)|heritage|crown-copyright|ogl3|historic-monument
tree|Tree|2021-12-27|||tree-preservation-order|"An individual tree"||"{ ""colour"": ""#3B453D"", ""type"": ""point"" }"|Trees|||geography|Q10884|Tree|environment|crown-copyright|ogl3|tree-preservation-orders
conservation-area|Conservation area|2022-06-06|||conservation-area|Special architectural or historic interest, the character or appearance of which it is desirable to preserve or enhance||"{ ""colour"": ""#78AA00"" }"|Conservation areas|||geography|Q5162904|Conservation_area_(United_Kingdom)|heritage|crown-copyright|ogl3|conservation-areas
Loading