.
This commit is contained in:
+3
-2
@@ -10,7 +10,7 @@ from django.forms.widgets import RadioSelect
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Examination)
|
||||
admin.site.register(Site)
|
||||
#admin.site.register(Site)
|
||||
admin.site.register(Exam)
|
||||
admin.site.register(Abnormality)
|
||||
admin.site.register(Region)
|
||||
@@ -41,7 +41,8 @@ class RapidAdminForm(ModelForm):
|
||||
|
||||
fields = [
|
||||
"normal", "abnormality", "region", "laterality", "examination",
|
||||
"site", "sign", "condition", "feedback", "author"
|
||||
#"site",
|
||||
"sign", "condition", "feedback", "author"
|
||||
]
|
||||
|
||||
widgets = {
|
||||
|
||||
+3
-1
@@ -7,4 +7,6 @@ class RapidFilter(django_filters.FilterSet):
|
||||
class Meta:
|
||||
model = Rapid
|
||||
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 Meta:
|
||||
model = RapidCreationDefault
|
||||
fields = ["site"]
|
||||
#fields = ["site"]
|
||||
exclude = ["author"]
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class RapidForm(ModelForm):
|
||||
"region",
|
||||
"laterality",
|
||||
"examination",
|
||||
"site",
|
||||
#"site",
|
||||
"feedback",
|
||||
]
|
||||
# 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
|
||||
|
||||
|
||||
from generic.models import Examination, Site, Condition, Sign
|
||||
|
||||
image_storage = FileSystemStorage(
|
||||
# Physical file location ROOT
|
||||
location=u"{0}/rapids/".format(settings.MEDIA_ROOT),
|
||||
@@ -65,15 +68,6 @@ class Examination(models.Model):
|
||||
class Meta:
|
||||
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):
|
||||
pass
|
||||
|
||||
@@ -163,12 +157,13 @@ class Rapid(models.Model):
|
||||
# to=Sign, blank=True, help_text='Radiological signs in the question')
|
||||
|
||||
DEFAULT_SITE_ID = 1
|
||||
site = models.ManyToManyField(
|
||||
Site,
|
||||
blank=True,
|
||||
default=DEFAULT_SITE_ID,
|
||||
help_text=
|
||||
"If we know the source of the image")
|
||||
#site = models.ManyToManyField(
|
||||
# Site,
|
||||
# related_name="site_rapid",
|
||||
# blank=True,
|
||||
# default=DEFAULT_SITE_ID,
|
||||
# help_text=
|
||||
# "If we know the source of the image")
|
||||
verified = models.BooleanField(default=False)
|
||||
created_date = models.DateTimeField(default=timezone.now)
|
||||
published_date = models.DateTimeField(blank=True, null=True)
|
||||
@@ -342,11 +337,12 @@ class RapidCreationDefault(models.Model):
|
||||
related_name="rapid_default",
|
||||
on_delete=models.CASCADE)
|
||||
|
||||
site = models.ManyToManyField(
|
||||
Site,
|
||||
blank=True,
|
||||
default=1,
|
||||
help_text="Default site to use when creating a new rapid")
|
||||
#site = models.ManyToManyField(
|
||||
# Site,
|
||||
# related_name="site_rapid_creation_default",
|
||||
# blank=True,
|
||||
# default=1,
|
||||
# help_text="Default site to use when creating a new rapid")
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('rapids:rapid_create')
|
||||
|
||||
+3
-1
@@ -44,5 +44,7 @@ class RapidTable(tables.Table):
|
||||
model = Rapid
|
||||
template_name = "django_tables2/bootstrap4.html"
|
||||
fields = ("normal", "abnormality", "region", "examination",
|
||||
"laterality", "site", "created_date", "author")
|
||||
"laterality",
|
||||
#"site",
|
||||
"created_date", "author")
|
||||
sequence = ("view", "images")
|
||||
Reference in New Issue
Block a user