From b9a5450066ad77e4647dfd95155d6b75beb95944 Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Sun, 13 Aug 2017 17:06:11 -0400 Subject: [PATCH] Clean up default files and add initial migration. --- api/apps.py | 5 -- api/urls.py | 3 + babyblotter/settings.py | 12 ---- babyblotter/urls.py | 16 +---- babyblotter/wsgi.py | 9 --- core/apps.py | 5 -- core/migrations/0001_initial.py | 102 ++++++++++++++++++++++++++++++++ core/views.py | 3 - 8 files changed, 107 insertions(+), 48 deletions(-) delete mode 100644 api/apps.py delete mode 100644 core/apps.py create mode 100644 core/migrations/0001_initial.py delete mode 100644 core/views.py diff --git a/api/apps.py b/api/apps.py deleted file mode 100644 index d87006dd..00000000 --- a/api/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class ApiConfig(AppConfig): - name = 'api' diff --git a/api/urls.py b/api/urls.py index cd5cac93..faa5826f 100644 --- a/api/urls.py +++ b/api/urls.py @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + from django.conf.urls import url, include from rest_framework import routers diff --git a/babyblotter/settings.py b/babyblotter/settings.py index 4c31d560..c55c5be4 100644 --- a/babyblotter/settings.py +++ b/babyblotter/settings.py @@ -1,15 +1,3 @@ -""" -Django settings for babyblotter project. - -Generated by 'django-admin startproject' using Django 1.11.4. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.11/ref/settings/ -""" - import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) diff --git a/babyblotter/urls.py b/babyblotter/urls.py index 0d6db60e..f048260a 100644 --- a/babyblotter/urls.py +++ b/babyblotter/urls.py @@ -1,18 +1,6 @@ -"""babyblotter URL Configuration +# -*- coding: utf-8 -*- +from __future__ import unicode_literals -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.11/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) -""" from django.conf.urls import url, include from django.contrib import admin diff --git a/babyblotter/wsgi.py b/babyblotter/wsgi.py index dc2d32e2..2891dd6b 100644 --- a/babyblotter/wsgi.py +++ b/babyblotter/wsgi.py @@ -1,12 +1,3 @@ -""" -WSGI config for babyblotter project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ -""" - import os from django.core.wsgi import get_wsgi_application diff --git a/core/apps.py b/core/apps.py deleted file mode 100644 index 26f78a8e..00000000 --- a/core/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class CoreConfig(AppConfig): - name = 'core' diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 00000000..fa25802e --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-08-13 21:05 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Baby', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('first_name', models.CharField(max_length=255)), + ('last_name', models.CharField(max_length=255)), + ('birth_date', models.DateField()), + ], + options={ + 'verbose_name_plural': 'Babies', + 'default_permissions': ('view', 'add', 'change', 'delete'), + 'ordering': ['last_name', 'first_name'], + }, + ), + migrations.CreateModel( + name='DiaperChange', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time', models.DateTimeField()), + ('wet', models.BooleanField()), + ('solid', models.BooleanField()), + ('color', models.CharField(blank=True, choices=[('black', 'Black'), ('brown', 'Brown'), ('green', 'Green'), ('yellow', 'Yellow')], max_length=255)), + ('baby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='diaper_change', to='core.Baby')), + ], + options={ + 'default_permissions': ('view', 'add', 'change', 'delete'), + 'ordering': ['-time'], + }, + ), + migrations.CreateModel( + name='Feeding', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('start', models.DateTimeField()), + ('end', models.DateTimeField()), + ('type', models.CharField(choices=[('breast milk', 'Breast milk'), ('formula', 'Formula')], max_length=255)), + ('method', models.CharField(choices=[('bottle', 'Bottle'), ('left breast', 'Left breast'), ('right breast', 'Right breast')], max_length=255)), + ('baby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feeding', to='core.Baby')), + ], + options={ + 'default_permissions': ('view', 'add', 'change', 'delete'), + 'ordering': ['-start'], + }, + ), + migrations.CreateModel( + name='Note', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('note', models.TextField()), + ('time', models.DateTimeField(auto_now=True)), + ('baby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='note', to='core.Baby')), + ], + options={ + 'default_permissions': ('view', 'add', 'change', 'delete'), + 'ordering': ['-time'], + }, + ), + migrations.CreateModel( + name='Sleep', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('start', models.DateTimeField()), + ('end', models.DateTimeField()), + ('baby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sleep', to='core.Baby')), + ], + options={ + 'verbose_name_plural': 'Sleep', + 'default_permissions': ('view', 'add', 'change', 'delete'), + 'ordering': ['-start'], + }, + ), + migrations.CreateModel( + name='TummyTime', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('start', models.DateTimeField()), + ('end', models.DateTimeField()), + ('milestone', models.CharField(blank=True, max_length=255)), + ('baby', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tummy_time', to='core.Baby')), + ], + options={ + 'default_permissions': ('view', 'add', 'change', 'delete'), + 'ordering': ['-start'], + }, + ), + ] diff --git a/core/views.py b/core/views.py deleted file mode 100644 index 91ea44a2..00000000 --- a/core/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here.