Skip to content

Commit

Permalink
#30 backend: add template-app
Browse files Browse the repository at this point in the history
  • Loading branch information
claasga committed Mar 25, 2024
1 parent 63290e7 commit a5a87a5
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/dps_training_k/configuration/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"corsheaders",
"game.apps.GameConfig",
"helpers.apps.GameConfig",
"templates.apps.GameConfig",
"rest_framework",
"rest_framework.authtoken",
"django_celery_beat",
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions backend/dps_training_k/template/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions backend/dps_training_k/template/apps.py
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.
3 changes: 3 additions & 0 deletions backend/dps_training_k/template/models.py
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 backend/dps_training_k/template/serializer/state_serialize.py
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",
]
3 changes: 3 additions & 0 deletions backend/dps_training_k/template/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions backend/dps_training_k/template/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.

0 comments on commit a5a87a5

Please sign in to comment.