Skip to content

Commit

Permalink
migrated norms app to new state with new fileds
Browse files Browse the repository at this point in the history
  • Loading branch information
expeditionengineer committed Nov 18, 2024
1 parent 6dba077 commit bcef448
Show file tree
Hide file tree
Showing 12 changed files with 688 additions and 171 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Generated by Django 5.0.9 on 2024-11-18 12:25

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("Datasets", "0021_historydataset"),
(
"project_listing",
"0003_alter_enargus_randdplanningcategory_and_more",
),
("tools_over", "0008_alter_tools_technicalstandardsprotocols"),
]

operations = [
migrations.AlterField(
model_name="dataset",
name="applicationArea",
field=models.ManyToManyField(
db_comment="Typical application area in which the dataset is used.",
to="tools_over.applicationarea",
),
),
migrations.AlterField(
model_name="dataset",
name="classification",
field=models.ManyToManyField(
db_comment="General type of dataset - Which type or of to which typ belongs the dataset. E.g. framework, programming language, ...",
to="tools_over.classification",
),
),
migrations.AlterField(
model_name="dataset",
name="focus",
field=models.ManyToManyField(
db_comment="Focus identifier - Selected focus (Definied by Wissensplattform)",
max_length=200,
to="tools_over.focus",
),
),
migrations.AlterField(
model_name="dataset",
name="specificApplication",
field=models.ManyToManyField(
blank=True,
db_comment="Specific use cases - Identification of concrete examples of the use of the item in the construction sector/energy transition (equals project number)",
to="project_listing.subproject",
),
),
]
7 changes: 1 addition & 6 deletions webcentral/src/Datasets/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import models
from django.db.models.functions import Now

from tools_over.models import (
from common.models import (
ApplicationArea,
Focus,
LifeCyclePhase,
Expand All @@ -19,19 +19,15 @@ class Dataset(models.Model):
name = models.CharField(max_length=200, db_comment="Name of the dataset")
applicationArea = models.ManyToManyField(
ApplicationArea,
max_length=200,
null=True,
db_comment="Typical application area in which the dataset is used.",
)
focus = models.ManyToManyField(
Focus,
max_length=200,
null=True,
db_comment="Focus identifier - Selected focus (Definied by Wissensplattform)",
)
classification = models.ManyToManyField(
Classification,
null=True,
db_comment="General type of dataset - Which type or of to which typ belongs the dataset. E.g. framework, programming language, ...",
)
lifeCyclePhase = models.ManyToManyField(
Expand Down Expand Up @@ -161,7 +157,6 @@ class Dataset(models.Model):
specificApplication = models.ManyToManyField(
Subproject,
blank=True,
null=True,
db_comment="Specific use cases - Identification of concrete examples of the use of the item in the construction sector/energy transition (equals project number)",
)

Expand Down
52 changes: 8 additions & 44 deletions webcentral/src/TechnicalStandards/data_export.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd
from django.db import models

from .models import Protocol
from .models import Norm


class DataExport:
Expand All @@ -10,52 +10,16 @@ class DataExport:
SEPARATOR_M2M = ";;"
MAPPING_ORM_TO_XLSX = {
"name": "name",
# "focus": "focus",
# "classification": "classification",
# "lifeCyclePhase": "lifeCyclePhase",
# "scale": "scale",
# "targetGroup": "targetGroup",
# "alternatives": "alternatives",
# "developmentState": "developmentState",
# "furtherInformation": "furtherInformation",
# "released": "released",
# "provider": "provider",
# "resources": "resources",
# "license": "license",
# "accessibility": "accessibility",
# "programmingLanguages": "programmingLanguages",
# "description": "description",
# "specificApplication": "specificApplication",
# "technicalStandardsNorms": "technicalStandardsNorms",
# "yearOfRelease": "yearOfRelease",
# "usage": "usage",
# "tools": "tools",
"communicationMediumCategory": "communicationMediumCategory",
"supportedTransmissionMediuems": "supportedTransmissionMediuems",
"associatedStandards": "associatedStandards",
"networkTopology": "networkTopology",
"security": "security",
"bandwidth": "bandwidth",
"frequency": "frequency",
"range": "range",
"numberOfConnectedDevices": "numberOfConnectedDevices",
"dataModelArchitecture": "dataModelArchitecture",
"discovery": "discovery",
"multiMaster": "multiMaster",
"packetSize": "packetSize",
"priorities": "priorities",
"price": "price",
"osiLayers": "osiLayers",
"buildingAutomationLayer": "buildingAutomationLayer",
"openSourceStatus": "openSourceStatus",
"licensingFeeRequirement": "licensingFeeRequirement",
# "exampleProject": "exampleProject",
"image": "image",
# "isNorm": "isNorm",
"title": "title",
# "image": "image",
"link": "link",
"shortDescription": "shortDescription",
"source": "source",
}

DATA_APP_DIR = "18_protocols"
EXPORT_MODEL_OBJ = Protocol
DATA_APP_DIR = "05_technical_standards"
EXPORT_MODEL_OBJ = Norm

def __init__(self, filename):
""" """
Expand Down
Loading

0 comments on commit bcef448

Please sign in to comment.