feat(people): Add network view

Network view shows people and relationships between them

Resolves #21
Resolves #20
Part of #14
This commit is contained in:
James Graham
2020-03-06 15:09:40 +00:00
parent 9b3b759254
commit b2fd9eeaf9
6 changed files with 198 additions and 2 deletions

26
people/serializers.py Normal file
View File

@@ -0,0 +1,26 @@
"""
Serialize models to and deserialize from JSON.
"""
from rest_framework import serializers
from . import models
class PersonSerializer(serializers.ModelSerializer):
class Meta:
model = models.Person
fields = [
'pk',
'name',
]
class RelationshipSerializer(serializers.ModelSerializer):
class Meta:
model = models.Relationship
fields = [
'pk',
'source',
'target',
]