.
This commit is contained in:
+3
-2
@@ -2,9 +2,10 @@ from longs.models import Exam
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
from .models import Examination, Sign, Site, Condition
|
from .models import Examination, Sign, Condition
|
||||||
|
#from .models import Examination, Sign, Site, Condition
|
||||||
|
|
||||||
admin.site.register(Examination)
|
admin.site.register(Examination)
|
||||||
admin.site.register(Sign)
|
admin.site.register(Sign)
|
||||||
admin.site.register(Site)
|
#admin.site.register(Site)
|
||||||
admin.site.register(Condition)
|
admin.site.register(Condition)
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:13
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('longs', '0008_auto_20210205_1013'),
|
||||||
|
('generic', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Site',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:22
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('generic', '0002_delete_site'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Site',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('site', models.CharField(max_length=200)),
|
||||||
|
('initials', models.CharField(max_length=200)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:31
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('generic', '0003_site'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelTable(
|
||||||
|
name='site',
|
||||||
|
table='rapids_site',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:35
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('generic', '0004_auto_20210205_1031'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelTable(
|
||||||
|
name='site',
|
||||||
|
table=None,
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:37
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('generic', '0005_auto_20210205_1035'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Site',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:39
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('generic', '0006_delete_site'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Site',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('site', models.CharField(max_length=200)),
|
||||||
|
('initials', models.CharField(max_length=200)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
+2
-1
@@ -9,7 +9,8 @@ from reversion.admin import VersionAdmin
|
|||||||
from django.forms.widgets import RadioSelect
|
from django.forms.widgets import RadioSelect
|
||||||
|
|
||||||
|
|
||||||
from generic.models import Examination, Sign, Site, Condition
|
#from generic.models import Examination, Sign, Site, Condition
|
||||||
|
from generic.models import Examination, Sign, Condition
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
#admin.site.register(Examination)
|
#admin.site.register(Examination)
|
||||||
|
|||||||
+2
-1
@@ -6,4 +6,5 @@ from .models import Long
|
|||||||
class LongFilter(django_filters.FilterSet):
|
class LongFilter(django_filters.FilterSet):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Long
|
model = Long
|
||||||
fields = ("site", "created_date", "author")
|
fields = (#"site",
|
||||||
|
"created_date", "author")
|
||||||
|
|||||||
+5
-2
@@ -9,7 +9,7 @@ from django.forms import (
|
|||||||
from django.forms import inlineformset_factory
|
from django.forms import inlineformset_factory
|
||||||
|
|
||||||
from longs.models import (
|
from longs.models import (
|
||||||
Examination,
|
#Examination,
|
||||||
Note,
|
Note,
|
||||||
Long,
|
Long,
|
||||||
LongSeries,
|
LongSeries,
|
||||||
@@ -19,6 +19,9 @@ from longs.models import (
|
|||||||
Exam,
|
Exam,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from generic.models import Examination, Condition, Sign
|
||||||
|
#from generic.models import Examination, Site, Condition, Sign
|
||||||
|
|
||||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||||
from django.forms.widgets import RadioSelect, TextInput, Textarea
|
from django.forms.widgets import RadioSelect, TextInput, Textarea
|
||||||
|
|
||||||
@@ -88,7 +91,7 @@ class LongForm(ModelForm):
|
|||||||
# fields = '__all__'
|
# fields = '__all__'
|
||||||
fields = [
|
fields = [
|
||||||
#"examination",
|
#"examination",
|
||||||
"site",
|
#"site",
|
||||||
"feedback",
|
"feedback",
|
||||||
]
|
]
|
||||||
# fields = ['question', 'feedback', 'subspecialty', 'references']
|
# fields = ['question', 'feedback', 'subspecialty', 'references']
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:13
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('longs', '0007_longseries_examination'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='long',
|
||||||
|
name='site',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='longcreationdefault',
|
||||||
|
name='site',
|
||||||
|
),
|
||||||
|
]
|
||||||
+13
-12
@@ -21,7 +21,8 @@ import string
|
|||||||
|
|
||||||
from anatomy.models import Modality
|
from anatomy.models import Modality
|
||||||
|
|
||||||
from generic.models import Examination, Site, Condition, Sign
|
from generic.models import Examination, Condition, Sign
|
||||||
|
#from generic.models import Examination, Site, Condition, Sign
|
||||||
|
|
||||||
image_storage = FileSystemStorage(
|
image_storage = FileSystemStorage(
|
||||||
# Physical file location ROOT
|
# Physical file location ROOT
|
||||||
@@ -62,12 +63,12 @@ class Long(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
DEFAULT_SITE_ID = 1
|
DEFAULT_SITE_ID = 1
|
||||||
site = models.ManyToManyField(
|
#site = models.ManyToManyField(
|
||||||
Site,
|
# Site,
|
||||||
blank=True,
|
# blank=True,
|
||||||
default=DEFAULT_SITE_ID,
|
# default=DEFAULT_SITE_ID,
|
||||||
help_text=
|
# help_text=
|
||||||
"If we know the source of the image")
|
# "If we know the source of the image")
|
||||||
verified = models.BooleanField(default=False)
|
verified = models.BooleanField(default=False)
|
||||||
created_date = models.DateTimeField(default=timezone.now)
|
created_date = models.DateTimeField(default=timezone.now)
|
||||||
published_date = models.DateTimeField(blank=True, null=True)
|
published_date = models.DateTimeField(blank=True, null=True)
|
||||||
@@ -181,11 +182,11 @@ class LongCreationDefault(models.Model):
|
|||||||
related_name="long_default",
|
related_name="long_default",
|
||||||
on_delete=models.CASCADE)
|
on_delete=models.CASCADE)
|
||||||
|
|
||||||
site = models.ManyToManyField(
|
#site = models.ManyToManyField(
|
||||||
Site,
|
# Site,
|
||||||
blank=True,
|
# blank=True,
|
||||||
default=1,
|
# default=1,
|
||||||
help_text="Default site to use when creating a new long")
|
# help_text="Default site to use when creating a new long")
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('longs:long_create')
|
return reverse('longs:long_create')
|
||||||
|
|||||||
+3
-2
@@ -10,7 +10,7 @@ from django.forms.widgets import RadioSelect
|
|||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
admin.site.register(Examination)
|
admin.site.register(Examination)
|
||||||
admin.site.register(Site)
|
#admin.site.register(Site)
|
||||||
admin.site.register(Exam)
|
admin.site.register(Exam)
|
||||||
admin.site.register(Abnormality)
|
admin.site.register(Abnormality)
|
||||||
admin.site.register(Region)
|
admin.site.register(Region)
|
||||||
@@ -41,7 +41,8 @@ class RapidAdminForm(ModelForm):
|
|||||||
|
|
||||||
fields = [
|
fields = [
|
||||||
"normal", "abnormality", "region", "laterality", "examination",
|
"normal", "abnormality", "region", "laterality", "examination",
|
||||||
"site", "sign", "condition", "feedback", "author"
|
#"site",
|
||||||
|
"sign", "condition", "feedback", "author"
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
|
|||||||
+3
-1
@@ -7,4 +7,6 @@ class RapidFilter(django_filters.FilterSet):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Rapid
|
model = Rapid
|
||||||
fields = ("normal", "abnormality", "region", "examination",
|
fields = ("normal", "abnormality", "region", "examination",
|
||||||
"laterality", "site", "created_date", "author")
|
"laterality",
|
||||||
|
#"site",
|
||||||
|
"created_date", "author")
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ class AbnormalityForm(ModelForm):
|
|||||||
class RapidCreationDefaultForm(ModelForm):
|
class RapidCreationDefaultForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = RapidCreationDefault
|
model = RapidCreationDefault
|
||||||
fields = ["site"]
|
#fields = ["site"]
|
||||||
exclude = ["author"]
|
exclude = ["author"]
|
||||||
|
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ class RapidForm(ModelForm):
|
|||||||
"region",
|
"region",
|
||||||
"laterality",
|
"laterality",
|
||||||
"examination",
|
"examination",
|
||||||
"site",
|
#"site",
|
||||||
"feedback",
|
"feedback",
|
||||||
]
|
]
|
||||||
# fields = ['question', 'feedback', 'subspecialty', 'references']
|
# fields = ['question', 'feedback', 'subspecialty', 'references']
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:46
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('rapids', '0008_auto_20210130_1515'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='rapid',
|
||||||
|
name='site',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='rapidcreationdefault',
|
||||||
|
name='site',
|
||||||
|
),
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Site',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-05 10:42
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('rapids', '0012_auto_20210205_1040'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
#migrations.RemoveField(
|
||||||
|
# model_name='rapid',
|
||||||
|
# name='site',
|
||||||
|
#),
|
||||||
|
#migrations.RemoveField(
|
||||||
|
# model_name='rapidcreationdefault',
|
||||||
|
# name='site',
|
||||||
|
#),
|
||||||
|
]
|
||||||
+16
-20
@@ -17,6 +17,9 @@ from sortedm2m.fields import SortedManyToManyField
|
|||||||
|
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
|
||||||
|
from generic.models import Examination, Site, Condition, Sign
|
||||||
|
|
||||||
image_storage = FileSystemStorage(
|
image_storage = FileSystemStorage(
|
||||||
# Physical file location ROOT
|
# Physical file location ROOT
|
||||||
location=u"{0}/rapids/".format(settings.MEDIA_ROOT),
|
location=u"{0}/rapids/".format(settings.MEDIA_ROOT),
|
||||||
@@ -65,15 +68,6 @@ class Examination(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('examination', )
|
ordering = ('examination', )
|
||||||
|
|
||||||
|
|
||||||
class Site(models.Model):
|
|
||||||
site = models.CharField(max_length=200)
|
|
||||||
initials = models.CharField(max_length=200)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.site
|
|
||||||
|
|
||||||
|
|
||||||
class Condition(tagulous.models.TagModel):
|
class Condition(tagulous.models.TagModel):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -163,12 +157,13 @@ class Rapid(models.Model):
|
|||||||
# to=Sign, blank=True, help_text='Radiological signs in the question')
|
# to=Sign, blank=True, help_text='Radiological signs in the question')
|
||||||
|
|
||||||
DEFAULT_SITE_ID = 1
|
DEFAULT_SITE_ID = 1
|
||||||
site = models.ManyToManyField(
|
#site = models.ManyToManyField(
|
||||||
Site,
|
# Site,
|
||||||
blank=True,
|
# related_name="site_rapid",
|
||||||
default=DEFAULT_SITE_ID,
|
# blank=True,
|
||||||
help_text=
|
# default=DEFAULT_SITE_ID,
|
||||||
"If we know the source of the image")
|
# help_text=
|
||||||
|
# "If we know the source of the image")
|
||||||
verified = models.BooleanField(default=False)
|
verified = models.BooleanField(default=False)
|
||||||
created_date = models.DateTimeField(default=timezone.now)
|
created_date = models.DateTimeField(default=timezone.now)
|
||||||
published_date = models.DateTimeField(blank=True, null=True)
|
published_date = models.DateTimeField(blank=True, null=True)
|
||||||
@@ -342,11 +337,12 @@ class RapidCreationDefault(models.Model):
|
|||||||
related_name="rapid_default",
|
related_name="rapid_default",
|
||||||
on_delete=models.CASCADE)
|
on_delete=models.CASCADE)
|
||||||
|
|
||||||
site = models.ManyToManyField(
|
#site = models.ManyToManyField(
|
||||||
Site,
|
# Site,
|
||||||
blank=True,
|
# related_name="site_rapid_creation_default",
|
||||||
default=1,
|
# blank=True,
|
||||||
help_text="Default site to use when creating a new rapid")
|
# default=1,
|
||||||
|
# help_text="Default site to use when creating a new rapid")
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('rapids:rapid_create')
|
return reverse('rapids:rapid_create')
|
||||||
|
|||||||
+3
-1
@@ -44,5 +44,7 @@ class RapidTable(tables.Table):
|
|||||||
model = Rapid
|
model = Rapid
|
||||||
template_name = "django_tables2/bootstrap4.html"
|
template_name = "django_tables2/bootstrap4.html"
|
||||||
fields = ("normal", "abnormality", "region", "examination",
|
fields = ("normal", "abnormality", "region", "examination",
|
||||||
"laterality", "site", "created_date", "author")
|
"laterality",
|
||||||
|
#"site",
|
||||||
|
"created_date", "author")
|
||||||
sequence = ("view", "images")
|
sequence = ("view", "images")
|
||||||
Reference in New Issue
Block a user