Initial commit

This commit is contained in:
Senad Uka
2019-01-14 13:15:49 +01:00
commit a107668d4b
34 changed files with 8762 additions and 0 deletions

0
crib/dough/__init__.py Normal file
View File

5
crib/dough/admin.py Normal file
View File

@@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Account, AccountItem
admin.site.register(Account)
admin.site.register(AccountItem)

5
crib/dough/apps.py Normal file
View File

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

View File

@@ -0,0 +1,35 @@
# Generated by Django 2.1.5 on 2019-01-13 13:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Account',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('question_text', models.CharField(max_length=200)),
('created_date', models.DateTimeField(verbose_name='date created')),
],
),
migrations.CreateModel(
name='AccountItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('collected', models.DecimalField(decimal_places=3, max_digits=10)),
('paid', models.DecimalField(decimal_places=3, max_digits=10)),
('description', models.CharField(blank=True, max_length=100)),
('when', models.DateTimeField(verbose_name='date and time created')),
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='dough.Account')),
('from_to', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='connected_items', to='dough.Account')),
],
),
]

View File

21
crib/dough/models.py Normal file
View File

@@ -0,0 +1,21 @@
from django.db import models
class Account(models.Model):
question_text = models.CharField(max_length=200)
created_date = models.DateTimeField('date created')
class AccountItem(models.Model):
account = models.ForeignKey(Account, on_delete=models.CASCADE,
related_name='items')
collected=models.DecimalField(max_digits=10, decimal_places=3)
paid=models.DecimalField(max_digits=10, decimal_places=3)
from_to= models.ForeignKey(Account, on_delete=models.CASCADE, blank=True,
related_name='connected_items')
description = models.CharField(max_length=100, blank=True)
when = models.DateTimeField('date and time created')

3
crib/dough/tests.py Normal file
View File

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

8
crib/dough/urls.py Normal file
View File

@@ -0,0 +1,8 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

5
crib/dough/views.py Normal file
View File

@@ -0,0 +1,5 @@
from django.http import HttpResponse
def index(request):
return HttpResponse("Dough!")