mirror of https://github.com/snachodog/mybuddy.git
Create skeleton of reports app.
This commit is contained in:
parent
7bffb41718
commit
8ae33b0f48
|
@ -18,6 +18,7 @@ INSTALLED_APPS = [
|
|||
'babyblotter',
|
||||
'core',
|
||||
'dashboard',
|
||||
'reports',
|
||||
|
||||
'rest_framework',
|
||||
'widget_tweaks',
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{% extends 'babyblotter/page.html' %}
|
||||
|
||||
{% block title %}Sleep Report - {{ object }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Sleep report for {{ object }}.
|
||||
{% endblock %}
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -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<slug>[^/.]+)/sleep/$',
|
||||
views.SleepReport.as_view(), name='report-sleep'),
|
||||
]
|
|
@ -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'
|
Loading…
Reference in New Issue