diff --git a/server/django/sensordata/migrations/0002_alter_resourcetype_data_type.py b/server/django/sensordata/migrations/0002_alter_resourcetype_data_type.py new file mode 100644 index 00000000..049652b8 --- /dev/null +++ b/server/django/sensordata/migrations/0002_alter_resourcetype_data_type.py @@ -0,0 +1,17 @@ +# Generated by Django 5.0.6 on 2024-05-27 21:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("sensordata", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="resourcetype", + name="data_type", + field=models.CharField(blank=True, max_length=50), + ), + ] diff --git a/server/django/sensordata/models.py b/server/django/sensordata/models.py index 70b166f8..aadaf125 100644 --- a/server/django/sensordata/models.py +++ b/server/django/sensordata/models.py @@ -10,7 +10,16 @@ class ResourceType(models.Model): object_id = models.IntegerField() resource_id = models.IntegerField() name = models.CharField(max_length=255) - data_type = models.CharField(max_length=50) # 'int', 'float', 'str', 'bool' + # LwM2M data types: + # - string: UTF-8 encoded sequence of characters + # - integer: 16-bit signed integer + # - float: 64-bit IEEE 754 floating point + # - boolean: 0 or 1 + # - opaque: sequence of binary data + # - time: POSIX time, number of s since 1970 in UTC (signed integer) + # - objlnk: link to another object instance + # - none (''): no data, used for executable resources + data_type = models.CharField(max_length=50, blank=True) class Meta: unique_together = ('object_id', 'resource_id')