Skip to content

Commit

Permalink
Create serializer for Person model
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtitherington committed Nov 20, 2023
1 parent a641bb6 commit 369550e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/app/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
from .project import Project, ProjectMembership
from .selector import Selector
from .environment import Environment
from .person import Person
1 change: 1 addition & 0 deletions backend/app/serializers/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .register_serializer import *
from .person_serializer import PersonSerializer
14 changes: 14 additions & 0 deletions backend/app/serializers/person_serializer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from rest_framework import serializers

from app.models.person import Person


class PersonSerializer(serializers.ModelSerializer):
class Meta(object):
model = Person
fields = ["email", "properties", "environment"]
extra_kwargs = {
"email": {"required": True},
"properties": {"required": True},
"environment": {"required": True},
}

0 comments on commit 369550e

Please sign in to comment.