.
This commit is contained in:
+4
-2
@@ -1,7 +1,7 @@
|
||||
from django.contrib import admin
|
||||
from .models import (
|
||||
AnatomyQuestion,
|
||||
Examination,
|
||||
#Examination,
|
||||
QuestionType,
|
||||
Answer,
|
||||
CidUserAnswer,
|
||||
@@ -12,6 +12,8 @@ from .models import (
|
||||
Structure,
|
||||
)
|
||||
|
||||
from generic.models import Examination
|
||||
|
||||
from reversion.admin import VersionAdmin
|
||||
|
||||
# Register your models here.
|
||||
@@ -47,7 +49,7 @@ class AnatomyAdmin(VersionAdmin):
|
||||
|
||||
|
||||
admin.site.register(AnatomyQuestion, AnatomyAdmin)
|
||||
admin.site.register(Examination)
|
||||
#admin.site.register(Examination)
|
||||
admin.site.register(QuestionType)
|
||||
admin.site.register(CidUserAnswer)
|
||||
admin.site.register(Exam)
|
||||
|
||||
+3
-1
@@ -6,5 +6,7 @@ from .models import AnatomyQuestion
|
||||
class AnatomyQuestionFilter(django_filters.FilterSet):
|
||||
class Meta:
|
||||
model = AnatomyQuestion
|
||||
fields = ("question_type", "exams", "examination", "modality", "region",
|
||||
fields = ("question_type", "exams",
|
||||
"examination",
|
||||
"modality", "region",
|
||||
"body_part", "created_date", "open_access", "author")
|
||||
|
||||
+2
-1
@@ -12,7 +12,7 @@ from .models import (
|
||||
Answer,
|
||||
CidUserAnswer,
|
||||
AnatomyQuestion,
|
||||
Examination,
|
||||
#Examination,
|
||||
BodyPart,
|
||||
Structure,
|
||||
Region,
|
||||
@@ -20,6 +20,7 @@ from .models import (
|
||||
QuestionType,
|
||||
Exam,
|
||||
)
|
||||
from generic.models import Examination
|
||||
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
from django.forms.widgets import RadioSelect, TextInput, Textarea
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.1.3 on 2021-02-05 11:06
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('generic', '0007_site'),
|
||||
('anatomy', '0024_auto_20210130_1515'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='anatomyquestion',
|
||||
name='examination',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='generic.examination'),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='Examination',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 3.1.3 on 2021-02-05 11:09
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('anatomy', '0025_auto_20210205_1106'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='anatomyquestion',
|
||||
name='examination',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.1.3 on 2021-02-05 11:10
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('generic', '0007_site'),
|
||||
('anatomy', '0026_remove_anatomyquestion_examination'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='anatomyquestion',
|
||||
name='examination',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='generic.examination'),
|
||||
),
|
||||
]
|
||||
+2
-7
@@ -13,6 +13,8 @@ from sortedm2m.fields import SortedManyToManyField
|
||||
|
||||
import string
|
||||
|
||||
from generic.models import Examination
|
||||
|
||||
image_storage = FileSystemStorage(
|
||||
# Physical file location ROOT
|
||||
location=u"{0}/anatomy/".format(settings.MEDIA_ROOT),
|
||||
@@ -26,13 +28,6 @@ def image_directory_path(instance, filename):
|
||||
return u"picture/{0}".format(filename)
|
||||
|
||||
|
||||
class Examination(models.Model):
|
||||
examination = models.CharField(max_length=200)
|
||||
|
||||
def __str__(self):
|
||||
return self.examination
|
||||
|
||||
|
||||
class BodyPart(models.Model):
|
||||
bodypart = models.CharField(max_length=200)
|
||||
|
||||
|
||||
+2
-1
@@ -36,13 +36,14 @@ from .models import (
|
||||
AnatomyQuestion,
|
||||
BodyPart,
|
||||
CidUserAnswer,
|
||||
Examination,
|
||||
#Examination,
|
||||
Structure,
|
||||
Exam,
|
||||
Answer,
|
||||
# HalfMarkAnswers,
|
||||
# IncorrectAnswers,
|
||||
)
|
||||
from generic.models import Examination
|
||||
|
||||
from .tables import AnatomyQuestionTable
|
||||
from .filters import AnatomyQuestionFilter
|
||||
|
||||
Reference in New Issue
Block a user