Sub-applications set up

This commit is contained in:
Kumi 2019-10-26 17:25:21 +02:00
parent f8a5c9fe15
commit 76b9f78b46
33 changed files with 173 additions and 12 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
db.sqlite3
*.swp
*.pyc
__pycache__/

0
buyer/__init__.py Normal file
View file

6
buyer/admin.py Normal file
View file

@ -0,0 +1,6 @@
from django.contrib import admin
from buyer.models import Card
# Register your models here.
admin.site.register(Card)

5
buyer/apps.py Normal file
View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class BuyerConfig(AppConfig):
name = 'buyer'

View file

@ -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')),
],
),
]

View file

8
buyer/models.py Normal file
View file

@ -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)

3
buyer/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
buyer/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

1
dbsettings/__init__.py Normal file
View file

@ -0,0 +1 @@
default_app_config = 'dbsettings.apps.SettingsConfig'

6
dbsettings/admin.py Normal file
View file

@ -0,0 +1,6 @@
from django.contrib import admin
from dbsettings.models import Setting
# Register your models here.
admin.site.register(Setting)

6
dbsettings/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class SettingsConfig(AppConfig):
name = 'dbsettings'
verbose_name = "Application Settings"

View file

@ -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)),
],
),
]

View file

7
dbsettings/models.py Normal file
View file

@ -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)

3
dbsettings/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
dbsettings/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
frontend/__init__.py Normal file
View file

3
frontend/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
frontend/apps.py Normal file
View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class FrontendConfig(AppConfig):
name = 'frontend'

View file

3
frontend/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
frontend/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
frontend/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
ledger/__init__.py Normal file
View file

6
ledger/admin.py Normal file
View file

@ -0,0 +1,6 @@
from django.contrib import admin
from ledger.models import Payment
# Register your models here.
admin.site.register(Payment)

5
ledger/apps.py Normal file
View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class LedgerConfig(AppConfig):
name = 'ledger'

View file

@ -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')),
],
),
]

View file

9
ledger/models.py Normal file
View file

@ -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)

3
ledger/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
ledger/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

@ -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"