From a6ec2d93d4e732ace895f52e5f7d7a773a8b759b Mon Sep 17 00:00:00 2001 From: tkupek Date: Sun, 31 Jan 2016 18:19:45 +0100 Subject: [PATCH] created data model --- db.sqlite3 | Bin 38912 -> 47104 bytes tkupek_elearning/elearning/admin.py | 15 +++++- tkupek_elearning/elearning/exampledata.sql | 4 ++ .../elearning/migrations/0001_initial.py | 49 ++++++++++++++++++ .../elearning/migrations/__init__.py | 0 tkupek_elearning/elearning/models.py | 34 +++++++++--- .../elearning/templates/css/style.css | 0 .../elearning/templates/images/favicon.ico | Bin 0 -> 32038 bytes .../elearning/templates/index.html | 9 +++- tkupek_elearning/elearning/views.py | 11 ++-- tkupek_elearning/urls.py | 2 +- 11 files changed, 110 insertions(+), 14 deletions(-) create mode 100644 tkupek_elearning/elearning/migrations/0001_initial.py create mode 100644 tkupek_elearning/elearning/migrations/__init__.py create mode 100644 tkupek_elearning/elearning/templates/css/style.css create mode 100644 tkupek_elearning/elearning/templates/images/favicon.ico diff --git a/db.sqlite3 b/db.sqlite3 index 67f9cb1f9064541707d1a7ccbee8a22040159975..bd44820c6d2a1e3403d7e44ccc8be4fdd24bd347 100644 GIT binary patch delta 4625 zcmc&%Yit}>6`nh1ybn8$lY0G%o8-o?cx!t-v+s34$;P`)Z0vO&Hf=0{8ShMX$KIWB zcV~^ginQ63h9spb>9mRR3o3q8h(FjC3PR-vAX-sC6~A~0s4EacC~c}hg-{~k&djcN zZ6_sFQ?c^io%!x}@BQvM=iYOC{=4+~59qJA?`A2Aa*=QO6TaH-LF~$xE`mkxI?%1% z0uQ>UVdgd3Q?LDp>E0C>;ygn>))fePe5~KQL;D%ivvUIsux>V>xoZwrATP)I+*+Z= zSHHpH0wK5dqnbd4#Cbd(Rf2LZ&=&}>J`W2uR7-c57t)ffy=raUn8fE}J^r9}&DvRk+#X-Rr@d+I>nTs- z4F>&gwjMH+4IBW!f_^vyufYu%hQEPhrFf5yHrE4(#FWTqWJylUJd+c%s-(y?p${No zj+Yb4jIsP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av+@0U;o&_{UcvRh0u0Ze^9Ns|96I5CxtGC*^7H z)AWpC;!oM;H4(`l2#``Av%A(IA20F&{D|#pTNRNck@rh=Fh@DTq~JIB0!&zh+b~xy z#h}aMB%RWenit`Nkr+nFwZ^I-Ijil8KZ{ZOlQpgYKeP9i@?t#y-d+%Qmv6dl?;15dZ6F zQ-gzUr&&$c*NByyTb?)1NW;U^19nc!o;y9YyFWT~{7B-sKHxii3TdY&!r{KmF~6!# z7T=Y_Q+-M{7CCR}r_x$<jPxNpm7hQ~6(JAuhqs9JIIFe3aBNu_o6G|+VwngddudW6{r9neDkNoIMWW{=xR(OnXY&pg=0 zHm$^SByJ>edpC>A54KkhefAAQWS>#gGdc-PFm$8z1D?J#SIK_#3(crrT(_`?uE*-a zl}&Zzssik!$R!)LTjq?HNV3jdG&~;tEDi=XA~DmZ9Ew-sY_FL>i4J zY);Q<8O=7x8gwm}&%8&o)b^1cdf%X7S~fDwszO@J+lX*UcoL-vebTVMzHeK00%das z>dl@*CYP@c-wcA+ zGRUO}mgyz6Ev{HV2A9=Qju=J8lEbA#Ge;=q2y+SO^$}l+%GWy?SI<6|C)|l=wl?Em z7j{6y1s*@XCD2Xy?^{P}OBV#zBM9`RUHH`1PP!e>UOkNOTx-VHF4p$jXv%Kms$VV? qj&PxoW5@P#ZP|(HtXi*cXr@&_xi-!qM~@SaBnSU>wWVeywew#ExwGN` diff --git a/tkupek_elearning/elearning/admin.py b/tkupek_elearning/elearning/admin.py index 0258562..2aae186 100644 --- a/tkupek_elearning/elearning/admin.py +++ b/tkupek_elearning/elearning/admin.py @@ -1,5 +1,16 @@ from django.contrib import admin -from tkupek_elearning.elearning.models import question +from tkupek_elearning.elearning.models import Option, Setting, Question -admin.site.register(question) \ No newline at end of file + +class OptionInline(admin.TabularInline): + model = Option + + +class QuestionAdmin(admin.ModelAdmin): + inlines = [ + OptionInline, + ] + +admin.site.register(Question, QuestionAdmin) +admin.site.register(Setting) \ No newline at end of file diff --git a/tkupek_elearning/elearning/exampledata.sql b/tkupek_elearning/elearning/exampledata.sql index 62e16e7..e5c988e 100644 --- a/tkupek_elearning/elearning/exampledata.sql +++ b/tkupek_elearning/elearning/exampledata.sql @@ -1,3 +1,7 @@ +#Settings +INSERT INTO elearning_setting (title, message, active) VALUES ('vcp bayern - elearning', 'servus beim elearning des vcp land bayern!', 1); + +#Questions INSERT INTO elearning_question (id, title, text, options, answer, explanation) VALUES (0, 'Bananen', 'Warum ist die Banane krumm?', 'eins zwei oder drei', 1, 'darum'); INSERT INTO elearning_question (id, title, text, options, answer, explanation) VALUES (1, 'Einstein', 'Wie lautet die Relativitätstheorie?', 'oben unten rechts links', 2, 'ich nehm die drei'); INSERT INTO elearning_question (id, title, text, options, answer, explanation) VALUES (2, 'Wetter', 'Wie wird das Wetter?', 'gut schlecht dramatisch', 3, 'darum'); \ No newline at end of file diff --git a/tkupek_elearning/elearning/migrations/0001_initial.py b/tkupek_elearning/elearning/migrations/0001_initial.py new file mode 100644 index 0000000..f6e79dd --- /dev/null +++ b/tkupek_elearning/elearning/migrations/0001_initial.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-01-31 17:13 +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='Option', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.CharField(max_length=100, null=True)), + ('correct', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='Question', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False)), + ('title', models.CharField(max_length=100, null=True)), + ('text', models.TextField(null=True)), + ('explanation', models.TextField(null=True)), + ], + ), + migrations.CreateModel( + name='Setting', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100, null=True)), + ('message', models.TextField(null=True)), + ('footer', models.TextField(null=True)), + ('active', models.BooleanField(default=False, unique=True)), + ], + ), + migrations.AddField( + model_name='option', + name='question', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='elearning.Question'), + ), + ] diff --git a/tkupek_elearning/elearning/migrations/__init__.py b/tkupek_elearning/elearning/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py index 283ebf1..5f50107 100644 --- a/tkupek_elearning/elearning/models.py +++ b/tkupek_elearning/elearning/models.py @@ -2,11 +2,31 @@ from __future__ import unicode_literals from django.db import models -class question(models.Model): - id = models.IntegerField(primary_key=True) - title = models.CharField(max_length=100) - text = models.TextField() - options = models.TextField() - answer = models.IntegerField() - explanation = models.TextField() \ No newline at end of file +class Setting(models.Model): + title = models.CharField(max_length=100, null=True) + message = models.TextField(null=True) + footer = models.TextField(null=True) + active = models.BooleanField(unique=True, default=False) + + def __str__(self): + return self.title + + +class Question(models.Model): + id = models.AutoField(primary_key=True) + title = models.CharField(max_length=100, null=True) + text = models.TextField(null=True) + explanation = models.TextField(null=True) + + def __str__(self): + return self.title + + +class Option(models.Model): + text = models.CharField(max_length=100, null=True) + correct = models.BooleanField(null=False, default=False) + question = models.ForeignKey(Question, on_delete=models.CASCADE, null=False) + + def __str__(self): + return self.text \ No newline at end of file diff --git a/tkupek_elearning/elearning/templates/css/style.css b/tkupek_elearning/elearning/templates/css/style.css new file mode 100644 index 0000000..e69de29 diff --git a/tkupek_elearning/elearning/templates/images/favicon.ico b/tkupek_elearning/elearning/templates/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..dbf52c7bb4e94788bba1be337d600d5815ce3b0c GIT binary patch literal 32038 zcmd^|2bfgV*?U8ru=g&i-eB%qm-j)rVxQy>d&3v-G@Jlyfx5J`==Y7`@6eQeFUh82 zuGw#1gQKAnw6qWW?%54qfnxM8#XIK0i{KuyGPGn*Xvcb|!(1qZEyd2^zH4vX5Bv^q z2{G6D!o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upek_elearning/elearning/templates/index.html index 470ea2f..d2f8414 100644 --- a/tkupek_elearning/elearning/templates/index.html +++ b/tkupek_elearning/elearning/templates/index.html @@ -12,7 +12,10 @@
-

VCP Bayern - eLearning

+

{{ settings.title }}

+

{{ settings.message }}

+
+
{% for question in questions %}

{{ question.id }}: {{ question.title }}

@@ -21,6 +24,10 @@

{{ question.explanation}}

{% endfor %} +
+
+ {{ settings.footer }} +
diff --git a/tkupek_elearning/elearning/views.py b/tkupek_elearning/elearning/views.py index ab2a4ee..802b8cc 100644 --- a/tkupek_elearning/elearning/views.py +++ b/tkupek_elearning/elearning/views.py @@ -1,9 +1,14 @@ from django.shortcuts import render_to_response -from tkupek_elearning.elearning.models import question +from tkupek_elearning.elearning.models import Setting, Question + +#import pdb; pdb.set_trace() def home(request): - questions = question.objects.all() + questions = Question.objects.all() + settings = Setting.objects.filter(active=1) + if(settings) : + settings = settings[0] - return render_to_response('index.html', {'questions': questions}) \ No newline at end of file + return render_to_response('index.html', {'settings': settings, 'questions': questions}) \ No newline at end of file diff --git a/tkupek_elearning/urls.py b/tkupek_elearning/urls.py index 7c14265..253e5f8 100644 --- a/tkupek_elearning/urls.py +++ b/tkupek_elearning/urls.py @@ -21,4 +21,4 @@ import tkupek_elearning.elearning.views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', tkupek_elearning.elearning.views.home) -] +] \ No newline at end of file