From d4079c44afedef630e257b0769d14f76099e6db5 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 21 Nov 2024 17:09:11 +0000 Subject: [PATCH] add read_only property to Question model We want to make some questions (e.g national data) read only so people can see the answers but not edit them because they are pure fact --- .../migrations/0060_question_read_only.py | 18 ++++++++++++++++++ crowdsourcer/models.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 crowdsourcer/migrations/0060_question_read_only.py diff --git a/crowdsourcer/migrations/0060_question_read_only.py b/crowdsourcer/migrations/0060_question_read_only.py new file mode 100644 index 0000000..864778b --- /dev/null +++ b/crowdsourcer/migrations/0060_question_read_only.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.16 on 2024-11-21 15:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("crowdsourcer", "0059_sessionconfig"), + ] + + operations = [ + migrations.AddField( + model_name="question", + name="read_only", + field=models.BooleanField(default=False), + ), + ] diff --git a/crowdsourcer/models.py b/crowdsourcer/models.py index e3e711c..a6a35a9 100644 --- a/crowdsourcer/models.py +++ b/crowdsourcer/models.py @@ -162,6 +162,7 @@ class Question(models.Model): previous_question = models.ForeignKey( "Question", blank=True, null=True, on_delete=models.SET_NULL ) + read_only = models.BooleanField(default=False) created = models.DateTimeField(auto_now_add=True) last_update = models.DateTimeField(auto_now=True)