add exam authors to collection/exam base
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-27 14:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('anatomy', '0015_alter_exam_exam_questions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='exam',
|
||||
name='authors_only',
|
||||
field=models.BooleanField(default=False, help_text='If true only exam/collection authors will be able to view.'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-27 14:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('atlas', '0044_seriesfinding_conditions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='casecollection',
|
||||
name='authors_only',
|
||||
field=models.BooleanField(default=False, help_text='If true only exam/collection authors will be able to view.'),
|
||||
),
|
||||
]
|
||||
@@ -29,3 +29,11 @@ class AuthorMixin():
|
||||
if not authors:
|
||||
return "None"
|
||||
return authors
|
||||
|
||||
def add_author(self, user: User):
|
||||
"""Add an author to the object"""
|
||||
self.author.add(user)
|
||||
|
||||
def remove_author(self, user: User):
|
||||
"""Remove an author from the object"""
|
||||
self.author.remove(user)
|
||||
|
||||
+5
-5
@@ -572,6 +572,11 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
|
||||
default=True,
|
||||
)
|
||||
|
||||
authors_only = models.BooleanField(
|
||||
help_text="If true only exam/collection authors will be able to view.",
|
||||
default=False,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
@@ -803,11 +808,6 @@ class ExamBase(ExamOrCollectionGenericBase):
|
||||
default=1, help_text="auto incrementing field when json recreated"
|
||||
)
|
||||
|
||||
authors_only = models.BooleanField(
|
||||
help_text="If true only exam authors will be able to view.",
|
||||
default=False,
|
||||
)
|
||||
|
||||
stats_mean = models.FloatField(default=0)
|
||||
stats_mode = models.CharField(default=0, max_length=25)
|
||||
stats_median = models.FloatField(default=0)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-27 14:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('longs', '0021_rename_rapid_examquestiondetail_question'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='exam',
|
||||
name='authors_only',
|
||||
field=models.BooleanField(default=False, help_text='If true only exam/collection authors will be able to view.'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-27 14:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('physics', '0008_alter_exam_exam_questions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='exam',
|
||||
name='authors_only',
|
||||
field=models.BooleanField(default=False, help_text='If true only exam/collection authors will be able to view.'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-27 14:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rapids', '0007_alter_exam_exam_questions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='exam',
|
||||
name='authors_only',
|
||||
field=models.BooleanField(default=False, help_text='If true only exam/collection authors will be able to view.'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-27 14:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('sbas', '0008_alter_exam_exam_questions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='exam',
|
||||
name='authors_only',
|
||||
field=models.BooleanField(default=False, help_text='If true only exam/collection authors will be able to view.'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user