.
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ class LongAdminForm(ModelForm):
|
|||||||
"model_differential_diagnosis",
|
"model_differential_diagnosis",
|
||||||
"model_management",
|
"model_management",
|
||||||
"author",
|
"author",
|
||||||
"sorted_series",
|
"series",
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 3.2.5 on 2021-08-11 17:37
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import sortedm2m.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('longs', '0041_long_sorted_series'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='longseries',
|
||||||
|
name='long',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='long',
|
||||||
|
name='sorted_series',
|
||||||
|
field=sortedm2m.fields.SortedManyToManyField(help_text=None, related_name='long', to='longs.LongSeries'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.5 on 2021-08-11 17:38
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('longs', '0042_auto_20210811_1837'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='long',
|
||||||
|
old_name='sorted_series',
|
||||||
|
new_name='series',
|
||||||
|
),
|
||||||
|
]
|
||||||
+7
-7
@@ -130,7 +130,7 @@ class Long(models.Model):
|
|||||||
question_json_id = models.IntegerField(default=1, help_text="Auto incrementing json creation number")
|
question_json_id = models.IntegerField(default=1, help_text="Auto incrementing json creation number")
|
||||||
|
|
||||||
|
|
||||||
sorted_series = SortedManyToManyField("LongSeries", related_name="long_sorted")
|
series = SortedManyToManyField("LongSeries", related_name="long")
|
||||||
|
|
||||||
#question_file = models.FileField(upload_to=question_file_directory_path, blank=True, null=True)
|
#question_file = models.FileField(upload_to=question_file_directory_path, blank=True, null=True)
|
||||||
|
|
||||||
@@ -340,12 +340,12 @@ class LongSeries(models.Model):
|
|||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
long = models.ManyToManyField(
|
#long = models.ManyToManyField(
|
||||||
"Long",
|
# "Long",
|
||||||
help_text="The question(s) this series should be associated with",
|
# help_text="The question(s) this series should be associated with",
|
||||||
related_name="series",
|
# related_name="series",
|
||||||
blank=True,
|
# blank=True,
|
||||||
)
|
#)
|
||||||
description = models.TextField(
|
description = models.TextField(
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Description of stack, for admin organisation, will not be visible when taking",
|
help_text="Description of stack, for admin organisation, will not be visible when taking",
|
||||||
|
|||||||
@@ -15,23 +15,6 @@
|
|||||||
{{series.get_block}}
|
{{series.get_block}}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="#" onclick="return window.create_popup_window('/longs/series/{{series.pk}}', 'Series')"
|
|
||||||
>Popup</a>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
{% endfor %}
|
|
||||||
<span><a href="{% url 'longs:long_series_id_create' pk=question.pk %}">Add new series</a><br/>
|
|
||||||
</div>
|
|
||||||
<br/>
|
|
||||||
<div class="pre-whitespace multi-image-block"><b>Sorted Series:</b>
|
|
||||||
{% for series in question.sorted_series.all %}
|
|
||||||
<span class="series-block">
|
|
||||||
<span>
|
|
||||||
Series {{ forloop.counter }}:
|
|
||||||
<a href="{% url 'longs:long_series_detail' pk=series.pk %}">
|
|
||||||
{{series.get_block}}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="#" onclick="return window.create_popup_window('/longs/series/{{series.pk}}', 'Series')"
|
<a href="#" onclick="return window.create_popup_window('/longs/series/{{series.pk}}', 'Series')"
|
||||||
>Popup</a>
|
>Popup</a>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user