Add initial implementation of survey model

This commit is contained in:
Ramon Wenger 2019-06-20 14:51:43 +02:00
parent 2494245b12
commit c9caaf79db
10 changed files with 68 additions and 0 deletions

View File

@ -53,6 +53,7 @@ INSTALLED_APPS = [
'basicknowledge',
'portfolio',
'statistics',
'surveys',
'wagtail.contrib.forms',
'wagtail.contrib.redirects',

View File

@ -0,0 +1,20 @@
# Generated by Django 2.0.6 on 2019-06-17 11:15
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('rooms', '0004_auto_20190210_2125'),
]
operations = [
migrations.AlterField(
model_name='roomentry',
name='contents',
field=wagtail.core.fields.StreamField([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock())])), ('image_url_block', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())]))], blank=True, null=True),
),
]

View File

3
server/surveys/admin.py Normal file
View File

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

5
server/surveys/apps.py Normal file
View File

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

View File

@ -0,0 +1,23 @@
# Generated by Django 2.0.6 on 2019-06-17 11:15
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Survey',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('data', django.contrib.postgres.fields.jsonb.JSONField()),
],
),
]

View File

10
server/surveys/models.py Normal file
View File

@ -0,0 +1,10 @@
from django.db import models
from django.contrib.postgres.fields import JSONField
class Survey(models.Model):
title = models.CharField(max_length=255)
data = JSONField()
def __str__(self):
return self.title

3
server/surveys/tests.py Normal file
View File

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

3
server/surveys/views.py Normal file
View File

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