summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202018-10-12 11:04:54 +0530
committerGitHub2018-10-12 11:04:54 +0530
commitd4b9b016f8b2c9a7ad660db96fb0d1dca8314ea7 (patch)
tree07d7e522ef2e8510253de5622a07c9bf5f798cff
parentdf5b673cfb13f4ce66146723384172ee981a6a07 (diff)
parent4ef74219b292acaaab56f34f46791f53bdcd5958 (diff)
downloadnccps-2018-d4b9b016f8b2c9a7ad660db96fb0d1dca8314ea7.tar.gz
nccps-2018-d4b9b016f8b2c9a7ad660db96fb0d1dca8314ea7.tar.bz2
nccps-2018-d4b9b016f8b2c9a7ad660db96fb0d1dca8314ea7.zip
Merge pull request #29 from Akshen/develop
Update Admin Model
-rw-r--r--website/admin.py21
-rw-r--r--website/migrations/0004_auto_20181004_1022.py45
-rw-r--r--website/migrations/0005_auto_20181005_0408.py23
-rw-r--r--website/migrations/0006_auto_20181005_0412.py18
-rw-r--r--website/migrations/0007_question_question_creation_day.py18
-rw-r--r--website/migrations/0008_auto_20181005_0535.py18
-rw-r--r--website/migrations/0009_auto_20181005_0538.py22
-rw-r--r--website/migrations/0010_auto_20181005_0544.py22
-rw-r--r--website/migrations/0011_auto_20181008_1039.py18
9 files changed, 205 insertions, 0 deletions
diff --git a/website/admin.py b/website/admin.py
index 8c38f3f..e244083 100644
--- a/website/admin.py
+++ b/website/admin.py
@@ -1,3 +1,24 @@
from django.contrib import admin
+from .models import( Profile,
+ AnswerPaper,
+ Question
+ )
+
+
+class ProfileAdmin(admin.ModelAdmin):
+ list_display = ['title','user', 'institute',
+ 'phone_number','position']
+
+
+class QuestionAdmin(admin.ModelAdmin):
+ list_display = ['question', 'correct_answer', 'question_day']
+
+
+class AnswerPaperAdmin(admin.ModelAdmin):
+ list_display = ['participant', 'answered_q', 'date']
+
# Register your models here.
+admin.site.register(Profile, ProfileAdmin)
+admin.site.register(AnswerPaper, AnswerPaperAdmin)
+admin.site.register(Question, QuestionAdmin) \ No newline at end of file
diff --git a/website/migrations/0004_auto_20181004_1022.py b/website/migrations/0004_auto_20181004_1022.py
new file mode 100644
index 0000000..51067a7
--- /dev/null
+++ b/website/migrations/0004_auto_20181004_1022.py
@@ -0,0 +1,45 @@
+# Generated by Django 2.1 on 2018-10-04 10:22
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0003_auto_20180919_1026'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='AnswerPaper',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('validate_ans', models.BooleanField()),
+ ('attempted', models.BooleanField()),
+ ('date', models.DateTimeField(auto_now=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Question',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('question', models.TextField()),
+ ('option_1', models.CharField(max_length=255)),
+ ('option_2', models.CharField(max_length=255)),
+ ('option_3', models.CharField(max_length=255)),
+ ('option_4', models.CharField(max_length=255)),
+ ('correct_answer', models.CharField(max_length=255)),
+ ],
+ ),
+ migrations.AddField(
+ model_name='answerpaper',
+ name='answered_q',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='website.Question'),
+ ),
+ migrations.AddField(
+ model_name='answerpaper',
+ name='participant',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='website.Profile'),
+ ),
+ ]
diff --git a/website/migrations/0005_auto_20181005_0408.py b/website/migrations/0005_auto_20181005_0408.py
new file mode 100644
index 0000000..04b52ef
--- /dev/null
+++ b/website/migrations/0005_auto_20181005_0408.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.1 on 2018-10-05 04:08
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0004_auto_20181004_1022'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='question',
+ name='question_day',
+ field=models.DateField(null=True),
+ ),
+ migrations.AlterField(
+ model_name='question',
+ name='correct_answer',
+ field=models.CharField(help_text='please write it as written in the option above(CAPS applicable)', max_length=255),
+ ),
+ ]
diff --git a/website/migrations/0006_auto_20181005_0412.py b/website/migrations/0006_auto_20181005_0412.py
new file mode 100644
index 0000000..e2e9dd9
--- /dev/null
+++ b/website/migrations/0006_auto_20181005_0412.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1 on 2018-10-05 04:12
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0005_auto_20181005_0408'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='question',
+ name='question_day',
+ field=models.DateField(),
+ ),
+ ]
diff --git a/website/migrations/0007_question_question_creation_day.py b/website/migrations/0007_question_question_creation_day.py
new file mode 100644
index 0000000..4dd8e82
--- /dev/null
+++ b/website/migrations/0007_question_question_creation_day.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1 on 2018-10-05 04:26
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0006_auto_20181005_0412'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='question',
+ name='question_creation_day',
+ field=models.DateField(auto_now=True),
+ ),
+ ]
diff --git a/website/migrations/0008_auto_20181005_0535.py b/website/migrations/0008_auto_20181005_0535.py
new file mode 100644
index 0000000..a24b0b3
--- /dev/null
+++ b/website/migrations/0008_auto_20181005_0535.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1 on 2018-10-05 05:35
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0007_question_question_creation_day'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='question',
+ name='question_day',
+ field=models.DateField(auto_now=True),
+ ),
+ ]
diff --git a/website/migrations/0009_auto_20181005_0538.py b/website/migrations/0009_auto_20181005_0538.py
new file mode 100644
index 0000000..c1709d2
--- /dev/null
+++ b/website/migrations/0009_auto_20181005_0538.py
@@ -0,0 +1,22 @@
+# Generated by Django 2.1 on 2018-10-05 05:38
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0008_auto_20181005_0535'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='question',
+ name='question_creation_day',
+ ),
+ migrations.AlterField(
+ model_name='question',
+ name='question_day',
+ field=models.DateField(),
+ ),
+ ]
diff --git a/website/migrations/0010_auto_20181005_0544.py b/website/migrations/0010_auto_20181005_0544.py
new file mode 100644
index 0000000..679f9dd
--- /dev/null
+++ b/website/migrations/0010_auto_20181005_0544.py
@@ -0,0 +1,22 @@
+# Generated by Django 2.1 on 2018-10-05 05:44
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0009_auto_20181005_0538'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='answerpaper',
+ name='attempted',
+ ),
+ migrations.AlterField(
+ model_name='question',
+ name='question_day',
+ field=models.DateField(help_text='Please follow the format YYYY-MM-DD as it is!'),
+ ),
+ ]
diff --git a/website/migrations/0011_auto_20181008_1039.py b/website/migrations/0011_auto_20181008_1039.py
new file mode 100644
index 0000000..8abca98
--- /dev/null
+++ b/website/migrations/0011_auto_20181008_1039.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.1 on 2018-10-08 10:39
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('website', '0010_auto_20181005_0544'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='question',
+ name='question_day',
+ field=models.DateField(),
+ ),
+ ]