-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class TemplatesConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'templates' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
26 changes: 26 additions & 0 deletions
26
backend/dps_training_k/template/serializer/state_serialize.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from rest_framework import serializers | ||
from game.models import PatientState | ||
|
||
|
||
class StateSerializer(serializers.Serializer): | ||
phaseNumber = serializers.IntegerField(source="current_phase", read_only=True) | ||
airway = serializers.CharField(source="data.airway", read_only=True) | ||
breathing = serializers.CharField(source="data.breathing", read_only=True) | ||
circulation = serializers.CharField(source="data.circulation", read_only=True) | ||
consciousness = serializers.CharField(source="data.consciousness", read_only=True) | ||
pupils = serializers.CharField(source="data.pupils", read_only=True) | ||
psyche = serializers.CharField(source="data.psyche", read_only=True) | ||
skin = serializers.CharField(source="data.skin", read_only=True) | ||
|
||
class Meta: | ||
model = PatientState | ||
fields = [ | ||
"phaseNumber", | ||
"airway", | ||
"breathing", | ||
"circulation", | ||
"consciousness", | ||
"pupils", | ||
"psyche", | ||
"skin", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |