From 76b9f78b46297849cf72aa34d585dc239e2a0841 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 26 Oct 2019 17:25:21 +0200 Subject: [PATCH] Sub-applications set up --- .gitignore | 4 ++++ buyer/__init__.py | 0 buyer/admin.py | 6 ++++++ buyer/apps.py | 5 +++++ buyer/migrations/0001_initial.py | 22 ++++++++++++++++++++++ buyer/migrations/__init__.py | 0 buyer/models.py | 8 ++++++++ buyer/tests.py | 3 +++ buyer/views.py | 3 +++ dbsettings/__init__.py | 1 + dbsettings/admin.py | 6 ++++++ dbsettings/apps.py | 6 ++++++ dbsettings/migrations/0001_initial.py | 21 +++++++++++++++++++++ dbsettings/migrations/__init__.py | 0 dbsettings/models.py | 7 +++++++ dbsettings/tests.py | 3 +++ dbsettings/views.py | 3 +++ frontend/__init__.py | 0 frontend/admin.py | 3 +++ frontend/apps.py | 5 +++++ frontend/migrations/__init__.py | 0 frontend/models.py | 3 +++ frontend/tests.py | 3 +++ frontend/views.py | 3 +++ ledger/__init__.py | 0 ledger/admin.py | 6 ++++++ ledger/apps.py | 5 +++++ ledger/migrations/0001_initial.py | 24 ++++++++++++++++++++++++ ledger/migrations/__init__.py | 0 ledger/models.py | 9 +++++++++ ledger/tests.py | 3 +++ ledger/views.py | 3 +++ susioma/settings.py | 20 ++++++++------------ 33 files changed, 173 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 buyer/__init__.py create mode 100644 buyer/admin.py create mode 100644 buyer/apps.py create mode 100644 buyer/migrations/0001_initial.py create mode 100644 buyer/migrations/__init__.py create mode 100644 buyer/models.py create mode 100644 buyer/tests.py create mode 100644 buyer/views.py create mode 100644 dbsettings/__init__.py create mode 100644 dbsettings/admin.py create mode 100644 dbsettings/apps.py create mode 100644 dbsettings/migrations/0001_initial.py create mode 100644 dbsettings/migrations/__init__.py create mode 100644 dbsettings/models.py create mode 100644 dbsettings/tests.py create mode 100644 dbsettings/views.py create mode 100644 frontend/__init__.py create mode 100644 frontend/admin.py create mode 100644 frontend/apps.py create mode 100644 frontend/migrations/__init__.py create mode 100644 frontend/models.py create mode 100644 frontend/tests.py create mode 100644 frontend/views.py create mode 100644 ledger/__init__.py create mode 100644 ledger/admin.py create mode 100644 ledger/apps.py create mode 100644 ledger/migrations/0001_initial.py create mode 100644 ledger/migrations/__init__.py create mode 100644 ledger/models.py create mode 100644 ledger/tests.py create mode 100644 ledger/views.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd2dd3a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +db.sqlite3 +*.swp +*.pyc +__pycache__/ diff --git a/buyer/__init__.py b/buyer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/buyer/admin.py b/buyer/admin.py new file mode 100644 index 0000000..d153908 --- /dev/null +++ b/buyer/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin +from buyer.models import Card + +# Register your models here. + +admin.site.register(Card) \ No newline at end of file diff --git a/buyer/apps.py b/buyer/apps.py new file mode 100644 index 0000000..71f464f --- /dev/null +++ b/buyer/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class BuyerConfig(AppConfig): + name = 'buyer' diff --git a/buyer/migrations/0001_initial.py b/buyer/migrations/0001_initial.py new file mode 100644 index 0000000..3d31614 --- /dev/null +++ b/buyer/migrations/0001_initial.py @@ -0,0 +1,22 @@ +# Generated by Django 2.2.6 on 2019-10-26 14:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Card', + fields=[ + ('number', models.IntegerField(primary_key=True, serialize=False, verbose_name='Card number')), + ('purchased', models.DateTimeField(auto_now_add=True, verbose_name='Card purchased')), + ('delivered', models.DateTimeField(default=None, null=True, verbose_name='Card delivered to Oma')), + ], + ), + ] diff --git a/buyer/migrations/__init__.py b/buyer/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/buyer/models.py b/buyer/models.py new file mode 100644 index 0000000..90ee8ca --- /dev/null +++ b/buyer/models.py @@ -0,0 +1,8 @@ +from django.db import models + +# Create your models here. + +class Card(models.Model): + number = models.IntegerField("Card number", primary_key=True) + purchased = models.DateTimeField("Card purchased", auto_now_add=True) + delivered = models.DateTimeField("Card delivered to Oma", default=None, null=True) \ No newline at end of file diff --git a/buyer/tests.py b/buyer/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/buyer/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/buyer/views.py b/buyer/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/buyer/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/dbsettings/__init__.py b/dbsettings/__init__.py new file mode 100644 index 0000000..8a9d1b7 --- /dev/null +++ b/dbsettings/__init__.py @@ -0,0 +1 @@ +default_app_config = 'dbsettings.apps.SettingsConfig' \ No newline at end of file diff --git a/dbsettings/admin.py b/dbsettings/admin.py new file mode 100644 index 0000000..4a7793a --- /dev/null +++ b/dbsettings/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin +from dbsettings.models import Setting + +# Register your models here. + +admin.site.register(Setting) \ No newline at end of file diff --git a/dbsettings/apps.py b/dbsettings/apps.py new file mode 100644 index 0000000..9f3e70f --- /dev/null +++ b/dbsettings/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class SettingsConfig(AppConfig): + name = 'dbsettings' + verbose_name = "Application Settings" \ No newline at end of file diff --git a/dbsettings/migrations/0001_initial.py b/dbsettings/migrations/0001_initial.py new file mode 100644 index 0000000..7db4b1e --- /dev/null +++ b/dbsettings/migrations/0001_initial.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.6 on 2019-10-26 15:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Setting', + fields=[ + ('key', models.CharField(max_length=512, primary_key=True, serialize=False)), + ('value', models.CharField(max_length=512)), + ], + ), + ] diff --git a/dbsettings/migrations/__init__.py b/dbsettings/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dbsettings/models.py b/dbsettings/models.py new file mode 100644 index 0000000..c26c0ce --- /dev/null +++ b/dbsettings/models.py @@ -0,0 +1,7 @@ +from django.db import models + +# Create your models here. + +class Setting(models.Model): + key = models.CharField(primary_key=True, max_length=512) + value = models.CharField(max_length=512) \ No newline at end of file diff --git a/dbsettings/tests.py b/dbsettings/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/dbsettings/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/dbsettings/views.py b/dbsettings/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/dbsettings/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/frontend/__init__.py b/frontend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/admin.py b/frontend/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/frontend/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/frontend/apps.py b/frontend/apps.py new file mode 100644 index 0000000..33ae5ca --- /dev/null +++ b/frontend/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class FrontendConfig(AppConfig): + name = 'frontend' diff --git a/frontend/migrations/__init__.py b/frontend/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/frontend/models.py b/frontend/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/frontend/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/frontend/tests.py b/frontend/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/frontend/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/frontend/views.py b/frontend/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/frontend/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/ledger/__init__.py b/ledger/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ledger/admin.py b/ledger/admin.py new file mode 100644 index 0000000..155cdd6 --- /dev/null +++ b/ledger/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin +from ledger.models import Payment + +# Register your models here. + +admin.site.register(Payment) \ No newline at end of file diff --git a/ledger/apps.py b/ledger/apps.py new file mode 100644 index 0000000..2f5609d --- /dev/null +++ b/ledger/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class LedgerConfig(AppConfig): + name = 'ledger' diff --git a/ledger/migrations/0001_initial.py b/ledger/migrations/0001_initial.py new file mode 100644 index 0000000..020f4ab --- /dev/null +++ b/ledger/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.6 on 2019-10-26 14:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Payment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.CharField(max_length=128, verbose_name='Payment description')), + ('amount', models.DecimalField(decimal_places=2, max_digits=15, verbose_name='Payment amount')), + ('date', models.DateTimeField(auto_now_add=True, verbose_name='Date of payment')), + ('repayment', models.DateTimeField(default=None, null=True, verbose_name='Date of repayment')), + ], + ), + ] diff --git a/ledger/migrations/__init__.py b/ledger/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ledger/models.py b/ledger/models.py new file mode 100644 index 0000000..1682efa --- /dev/null +++ b/ledger/models.py @@ -0,0 +1,9 @@ +from django.db import models + +# Create your models here. + +class Payment(models.Model): + description = models.CharField("Payment description", max_length=128) + amount = models.DecimalField("Payment amount", max_digits=15, decimal_places=2) + date = models.DateTimeField("Date of payment", auto_now_add=True) + repayment = models.DateTimeField("Date of repayment", default=None, null=True) \ No newline at end of file diff --git a/ledger/tests.py b/ledger/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/ledger/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/ledger/views.py b/ledger/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/ledger/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/susioma/settings.py b/susioma/settings.py index 98873e4..4460a4f 100644 --- a/susioma/settings.py +++ b/susioma/settings.py @@ -1,15 +1,3 @@ -""" -Django settings for susioma project. - -Generated by 'django-admin startproject' using Django 2.2.6. - -For more information on this file, see -https://docs.djangoproject.com/en/2.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/2.2/ref/settings/ -""" - import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -37,6 +25,10 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'buyer', + 'ledger', + 'frontend', + 'dbsettings', ] MIDDLEWARE = [ @@ -118,3 +110,7 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.2/howto/static-files/ STATIC_URL = '/static/' + +# Custom settings for Susioma project + +PROJECT_NAME = "Susioma's Self Service"