feat(people): Add detail views for Person and Relationship

This commit is contained in:
James Graham
2020-02-18 14:38:41 +00:00
parent 026fc10999
commit 4b2abd5d6c
6 changed files with 161 additions and 0 deletions

25
people/views.py Normal file
View File

@@ -0,0 +1,25 @@
"""
Views for displaying or manipulating models in the 'people' app.
"""
from django.views.generic import DetailView
from . import models
class ProfileView(DetailView):
"""
View displaying the profile of a :class:`Person` - who may be a user.
"""
model = models.Person
template_name = 'people/person/detail.html'
context_object_name = 'person'
class RelationshipDetailView(DetailView):
"""
View displaying details of a :class:`Relationship`.
"""
model = models.Relationship
template_name = 'people/relationship/detail.html'
context_object_name = 'relationship'