From 390fc5ad6565ebc5a6e0afe87e074493cd04bfd5 Mon Sep 17 00:00:00 2001 From: Tiago Assuncao Date: Mon, 15 May 2017 11:34:26 -0300 Subject: [PATCH] Adding is critical to serializers --- .../migrations/0003_bodysignal_is_critical.py | 20 +++++++++++++++++++ .../migrations/0004_auto_20170515_1432.py | 20 +++++++++++++++++++ .../migrations/0005_auto_20170515_1433.py | 20 +++++++++++++++++++ umiss_project/body_sign/models.py | 1 - umiss_project/body_sign/serializers.py | 6 +++--- 5 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 umiss_project/body_sign/migrations/0003_bodysignal_is_critical.py create mode 100644 umiss_project/body_sign/migrations/0004_auto_20170515_1432.py create mode 100644 umiss_project/body_sign/migrations/0005_auto_20170515_1433.py diff --git a/umiss_project/body_sign/migrations/0003_bodysignal_is_critical.py b/umiss_project/body_sign/migrations/0003_bodysignal_is_critical.py new file mode 100644 index 0000000..6af85f7 --- /dev/null +++ b/umiss_project/body_sign/migrations/0003_bodysignal_is_critical.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-05-15 14:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('body_sign', '0002_bodysignal_owner'), + ] + + operations = [ + migrations.AddField( + model_name='bodysignal', + name='is_critical', + field=models.BooleanField(default=False, editable=False), + ), + ] diff --git a/umiss_project/body_sign/migrations/0004_auto_20170515_1432.py b/umiss_project/body_sign/migrations/0004_auto_20170515_1432.py new file mode 100644 index 0000000..1be7531 --- /dev/null +++ b/umiss_project/body_sign/migrations/0004_auto_20170515_1432.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-05-15 14:32 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('body_sign', '0003_bodysignal_is_critical'), + ] + + operations = [ + migrations.AlterField( + model_name='bodysignal', + name='is_critical', + field=models.BooleanField(), + ), + ] diff --git a/umiss_project/body_sign/migrations/0005_auto_20170515_1433.py b/umiss_project/body_sign/migrations/0005_auto_20170515_1433.py new file mode 100644 index 0000000..2465353 --- /dev/null +++ b/umiss_project/body_sign/migrations/0005_auto_20170515_1433.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2017-05-15 14:33 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('body_sign', '0004_auto_20170515_1432'), + ] + + operations = [ + migrations.AlterField( + model_name='bodysignal', + name='is_critical', + field=models.BooleanField(default=False), + ), + ] diff --git a/umiss_project/body_sign/models.py b/umiss_project/body_sign/models.py index 50199d5..da206ca 100644 --- a/umiss_project/body_sign/models.py +++ b/umiss_project/body_sign/models.py @@ -14,7 +14,6 @@ class BodySignal(models.Model): is_critical = models.BooleanField( blank=False, null=False, - editable=False, default=False, ) diff --git a/umiss_project/body_sign/serializers.py b/umiss_project/body_sign/serializers.py index 55aed80..34bc19e 100644 --- a/umiss_project/body_sign/serializers.py +++ b/umiss_project/body_sign/serializers.py @@ -8,7 +8,7 @@ class HeartBeatsSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = HeartBeats - fields = ('owner', 'created', 'beats') + fields = ('owner', 'created', 'beats', 'is_critical') class GalvanicResistanceSerializer(serializers.HyperlinkedModelSerializer): @@ -16,7 +16,7 @@ class GalvanicResistanceSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = GalvanicResistance - fields = ('owner', 'created', 'resistance') + fields = ('owner', 'created', 'resistance', 'is_critical') class SkinTemperatureSerializer(serializers.HyperlinkedModelSerializer): @@ -24,4 +24,4 @@ class SkinTemperatureSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = SkinTemperature - fields = ('owner', 'created', 'temperature') + fields = ('owner', 'created', 'temperature', 'is_critical')