mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 03:17:07 +00:00
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:
26
people/serializers.py
Normal file
26
people/serializers.py
Normal 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',
|
||||
]
|
||||
Reference in New Issue
Block a user