Skip to content

Commit

Permalink
Adding is critical to serializers
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoAssuncao committed May 15, 2017
1 parent 70477ae commit 390fc5a
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 4 deletions.
20 changes: 20 additions & 0 deletions umiss_project/body_sign/migrations/0003_bodysignal_is_critical.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
20 changes: 20 additions & 0 deletions umiss_project/body_sign/migrations/0004_auto_20170515_1432.py
Original file line number Diff line number Diff line change
@@ -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(),
),
]
20 changes: 20 additions & 0 deletions umiss_project/body_sign/migrations/0005_auto_20170515_1433.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
1 change: 0 additions & 1 deletion umiss_project/body_sign/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class BodySignal(models.Model):
is_critical = models.BooleanField(
blank=False,
null=False,
editable=False,
default=False,
)

Expand Down
6 changes: 3 additions & 3 deletions umiss_project/body_sign/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ class HeartBeatsSerializer(serializers.HyperlinkedModelSerializer):

class Meta:
model = HeartBeats
fields = ('owner', 'created', 'beats')
fields = ('owner', 'created', 'beats', 'is_critical')


class GalvanicResistanceSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.ReadOnlyField(source='owner.username')

class Meta:
model = GalvanicResistance
fields = ('owner', 'created', 'resistance')
fields = ('owner', 'created', 'resistance', 'is_critical')


class SkinTemperatureSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.ReadOnlyField(source='owner.username')

class Meta:
model = SkinTemperature
fields = ('owner', 'created', 'temperature')
fields = ('owner', 'created', 'temperature', 'is_critical')

0 comments on commit 390fc5a

Please sign in to comment.