diff --git a/babyblotter/migrations/__init__.py b/babyblotter/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/babyblotter/settings/base.py b/babyblotter/settings/base.py index 49b5bc07..545e2652 100644 --- a/babyblotter/settings/base.py +++ b/babyblotter/settings/base.py @@ -18,6 +18,7 @@ INSTALLED_APPS = [ 'babyblotter', 'core', 'dashboard', + 'reports', 'rest_framework', 'widget_tweaks', diff --git a/reports/__init__.py b/reports/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/reports/migrations/__init__.py b/reports/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/reports/templates/reports/sleep.html b/reports/templates/reports/sleep.html new file mode 100644 index 00000000..fd1f1432 --- /dev/null +++ b/reports/templates/reports/sleep.html @@ -0,0 +1,7 @@ +{% extends 'babyblotter/page.html' %} + +{% block title %}Sleep Report - {{ object }}{% endblock %} + +{% block content %} + Sleep report for {{ object }}. +{% endblock %} \ No newline at end of file diff --git a/reports/tests.py b/reports/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/reports/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/reports/urls.py b/reports/urls.py new file mode 100644 index 00000000..f812e1e1 --- /dev/null +++ b/reports/urls.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^reports/(?P[^/.]+)/sleep/$', + views.SleepReport.as_view(), name='report-sleep'), +] diff --git a/reports/views.py b/reports/views.py new file mode 100644 index 00000000..78e8d3ea --- /dev/null +++ b/reports/views.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib.auth.mixins import PermissionRequiredMixin +from django.views.generic.detail import DetailView + +from core.models import Child + + +class SleepReport(PermissionRequiredMixin, DetailView): + model = Child + permission_required = ('core.view_child',) + template_name = 'reports/sleep.html'