From 790fad19efaf0601e5832ebff2ab5861492a02f1 Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 7 Apr 2023 12:07:09 -0700 Subject: [PATCH 1/2] SAGE-1631 Port Sensor Hardware Metadata to beekeper manifest Add description text field --- manifests/models.py | 1 + manifests/serializers.py | 1 + 2 files changed, 2 insertions(+) diff --git a/manifests/models.py b/manifests/models.py index 11edc01..40ad328 100644 --- a/manifests/models.py +++ b/manifests/models.py @@ -25,6 +25,7 @@ class AbstractHardware(models.Model): manufacturer = models.CharField(max_length=255, default="", blank=True) datasheet = models.CharField(max_length=255, default="", blank=True) capabilities = models.ManyToManyField("Capability", blank=True) + description = models.TextField(blank=True) class Meta: abstract = True diff --git a/manifests/serializers.py b/manifests/serializers.py index 47972ec..7bfb659 100644 --- a/manifests/serializers.py +++ b/manifests/serializers.py @@ -75,6 +75,7 @@ def serialize_common_hardware(h): "manufacturer": h.manufacturer, "datasheet": h.datasheet, "capabilities": [cap.capability for cap in h.capabilities.all()], + "description": h.description, } From 0258b98b25461fe6f674fa16e04af728e0e69636 Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 7 Apr 2023 12:23:32 -0700 Subject: [PATCH 2/2] SAGE-1631 Port Sensor Hardware Metadata to beekeper manifest Add migration script for description --- ...04_computehardware_description_and_more.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 manifests/migrations/0004_computehardware_description_and_more.py diff --git a/manifests/migrations/0004_computehardware_description_and_more.py b/manifests/migrations/0004_computehardware_description_and_more.py new file mode 100644 index 0000000..46a7c9a --- /dev/null +++ b/manifests/migrations/0004_computehardware_description_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.1.8 on 2023-04-07 18:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('manifests', '0003_computesensor_serial_no_computesensor_uri_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='computehardware', + name='description', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='resourcehardware', + name='description', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='sensorhardware', + name='description', + field=models.TextField(blank=True), + ), + ]