List of Seshat Experts
+Name | +Role | +Actions | +
---|---|---|
{{ expert }} | +{{ expert.role }} | + +|
No experts found. | +
{{user.first_name}} {{user.last_name}}
Notifications:
Notifications:
Comment | -Full Discussion | -Last Modified | -
---|
+ |
{% autoescape off %}
{{a_private_comment_part.private_comment_owner}}
+ {{a_private_comment_part.last_modified_date|naturaltime}}
+
+ Full Discussion
+
+
+
+ + {{a_private_comment_part.private_comment_part_text}} {% endautoescape %} |
- - Full Discussion - - | - - {% autoescape off %} -{{a_private_comment_part.last_modified_date|naturaltime}} | - {% endautoescape %}|||||
+ |
{% autoescape off %}
- {{a_private_comment_part.private_comment_owner}}
+ {{a_private_comment_part.private_comment_owner}}
+
+ {{a_private_comment_part.last_modified_date|naturaltime}}
+
+ Full Discussion
+
+
+
+ + + {% if a_private_comment_part.private_comment.general_polity_preceding_entity_related %} + {% endif %} + + + {{a_private_comment_part.private_comment_part_text}} {% endautoescape %} |
- - Full Discussion - - | - - {% autoescape off %} -{{a_private_comment_part.last_modified_date|naturaltime}} | - {% endautoescape %}
Comment | -Full Discussion | -Last Modified | -
---|
+ |
{% autoescape off %}
{{a_private_comment_part.private_comment_owner}}
- {{a_private_comment_part.private_comment_part_text}}
+ {{a_private_comment_part.last_modified_date|naturaltime}}
+ Full Discussion
+
+
+
+ {{a_private_comment_part.private_comment_part_text}} {% endautoescape %} + |
- - Full Discussion - - | - - {% autoescape off %} -{{a_private_comment_part.last_modified_date|naturaltime}} | - {% endautoescape %}|||||
+ |
{% autoescape off %}
- {{a_private_comment_part.private_comment_owner}}
+ {{a_private_comment_part.private_comment_owner}}
+
+ {{a_private_comment_part.last_modified_date|naturaltime}}
+
+ Full Discussion
+
+
+
+ + {{a_private_comment_part.private_comment_part_text}} {% endautoescape %} |
- - Full Discussion - - | - - {% autoescape off %} -{{a_private_comment_part.last_modified_date|naturaltime}} | - {% endautoescape %}
Comment | -Full Discussion | -Last Modified | -
---|
+ |
{% autoescape off %}
{{a_private_comment_part.private_comment_owner}}
+ {{a_private_comment_part.last_modified_date|naturaltime}}
+
+ Full Discussion
+
+
+ {{a_private_comment_part.private_comment_part_text}} {% endautoescape %} |
- - Full Discussion - - | - - {% autoescape off %} -{{a_private_comment_part.last_modified_date|naturaltime}} | - {% endautoescape %}|||||
+ |
{% autoescape off %}
- {{a_private_comment_part.private_comment_owner}}
+ {{a_private_comment_part.private_comment_owner}}
+
+ {{a_private_comment_part.last_modified_date|naturaltime}}
+
+ Full Discussion
+
+
+
+ {{a_private_comment_part.private_comment_part_text}} {% endautoescape %} |
- - Full Discussion - - | - - {% autoescape off %} -{{a_private_comment_part.last_modified_date|naturaltime}} | - {% endautoescape %}
ID | +UID | +Full Name | +Role | +Groups | +Permissions | +Date Joined | + +||
---|---|---|---|---|---|---|---|---|
{{ expert.id }} | +{{ expert.user_id }} | + ++ {% if expert.user.first_name and expert.user.last_name %} + {{ expert.user.first_name }} {{ expert.user.last_name }} + {% else %} + N/A + {% endif %} + | ++ {% if expert.user|is_user_real and expert.iser_id != 150 %} + {{ expert.user.email }} + {% else %} + - + {% endif %} + | +{{ expert.role }} | + ++ {% for group in expert.user.related_groups %} + {% if group.name == "Seshat Users First Round" %} + + {% elif group.name == "Chief Seshat Researchers" %} + + + {% elif group.name == "Chief Seshat External Experts" %} + + + {% elif group.name == "Chief Seshat Admins" %} + + {% else %} + {% if request.user.email == 'benam.mjd@gmail.com' %} + {{group.name}} + {% endif %} + + {% endif %} + {% endfor %} + | ++ + + + {% for perm in expert.user.related_permissions %} + {% if perm.name == "Can add capital" %} + + + + + {% elif perm.name == "Can add seshat private comment part" %} + + {% else %} + {% if request.user.email == 'benamggg.mjd@gmail.com' %} + {{perm.name}} + {% endif %} + + {% endif %} + {% endfor %} + + + | +{{ expert.user.date_joined|date:"Y-m-d" }} | + +|
No experts found. | +
" + private_comment_full_text = f'' + str(private_comment_part.private_comment_owner) + " " + private_comment_part.private_comment_part_text + "
" private_comment_parts.append(private_comment_full_text) if not private_comment_parts or private_comment_parts == [None]: to_be_shown = " Nothing " @@ -235,6 +267,103 @@ def __str__(self) -> str: to_be_shown = "EMPTY_PRIVATE_COMMENT" return f'{to_be_shown}' + def show_inline(self) -> str: + all_private_comment_parts = self.inner_private_comments_related.all().order_by('created_date') + if all_private_comment_parts: + private_comment_parts = [] + for private_comment_part in all_private_comment_parts: + # Assign a color for the owner + owner_color = give_me_a_color_for_expert(private_comment_part.private_comment_owner.id) + + # Create the owner badge + owner_badge = ( + f'' + f'{private_comment_part.private_comment_owner}' + ) + + # Assign colors to each reader and create reader badges + reader_badges = [] + for reader in private_comment_part.private_comment_reader.all(): + reader_color = give_me_a_color_for_expert(reader.id) # Use the same function for readers + reader_badge = ( + f'' + f'{reader}' + ) + reader_badges.append(reader_badge) + + # Combine the owner badge, reader badges, and comment text + readers_html = " " + " ".join(reader_badges) if reader_badges else " " + private_comment_full_text = ( + f"
+{% else %} + - +{% endif %} +{% if obj.comment and obj.comment.id > 1 %} + {{ obj.comment }} + +{% endif %} +{% endautoescape %} diff --git a/seshat/apps/core/templates/core/detail_base_for_new_approach.html b/seshat/apps/core/templates/core/detail_base_for_new_approach.html index 0b0e24b64..6eee4a9de 100644 --- a/seshat/apps/core/templates/core/detail_base_for_new_approach.html +++ b/seshat/apps/core/templates/core/detail_base_for_new_approach.html @@ -113,17 +113,17 @@
Section: {{object.section}}
Fact Under Review:
-
- A Seshat Expert will confirm it soon. Please wait.
-
+
{{my_exp}}
Expert?
- : Not yet Checked by a Seshat Expert.
: Checked and accepted by a Seshat Expert (or RA).
+ : Not yet Checked by a Seshat Expert.
: Checked and accepted by a Seshat Expert.
: Checked and accepted by a Seshat Expert (or RA).
: Checked and accepted by a Seshat Expert.
-
+
+ {% if a_trans.has_description %}
+
+ {% else %}
+
+ {% endif %}
+
-
+
{% if a_trans.year_from == None and a_trans.year_to == None %}
- {% elif a_trans.year_from == None and a_trans.year_to != None %}
- ?
-
+ {% elif a_trans.year_to != None %}
{% if a_trans.year_to < 0 %}
{{ a_trans.year_to|abs }}
@@ -228,82 +232,28 @@ BCE
-
- {% else %}
- {{ a_trans.year_from }}
-
- CE
-
- {% endif %}
- ?
+ ?
-
- {% elif a_trans.year_from == a_trans.year_to %}
- {% if a_trans.year_from < 0 %}
- {{ a_trans.year_from|abs }}
-
- BCE
-
- {% else %}
- {{ a_trans.year_from }}
-
- CE
-
- {% endif %}
{% elif a_trans.year_to == None %}
- {% if a_trans.year_from < 0 %}
- {{ a_trans.year_from|abs }}
-
- BCE
-
- {% else %}
- {{ a_trans.year_from }}
-
- CE
-
- {% endif %}
+ ?
{% elif a_trans.year_to == None and a_trans.year_from == None %}
{% else %}
- {% if a_trans.year_from < 0 and a_trans.year_to < 0 %}
- {{ a_trans.year_from|abs }}
-
- BCE
-
- {{ a_trans.year_to|abs }}
- BCE
-
- {% elif a_trans.year_from < 0 and a_trans.year_to >= 0 %}
- {{ a_trans.year_from|abs }}
- BCE
- {{ a_trans.year_to }}
- CE
-
- {% else %}
- {{ a_trans.year_from }}
- CE
- {{ a_trans.year_to }}
- CE
-
- {% endif %}
+ xyz
{% endif %}
{% if info_list.polity_end_year < a_trans.year_to %}
- *Bad Years...
+ *
{% endif %}
-
+
{{ a_trans.predecessor }}
-
+
-
+
{{ a_trans.successor }}
diff --git a/seshat/apps/core/templates/core/list_base_all_wf.html b/seshat/apps/core/templates/core/list_base_all_wf.html
index 6b061da76..b9410f56d 100644
--- a/seshat/apps/core/templates/core/list_base_all_wf.html
+++ b/seshat/apps/core/templates/core/list_base_all_wf.html
@@ -109,7 +109,7 @@
Expert?
- : Not yet Checked by a Seshat Expert.
: Checked and accepted by a Seshat Expert (or RA).
+ : Not yet Checked by a Seshat Expert.
: Checked and accepted by a Seshat Expert.
: Checked and accepted by a Seshat Expert (or RA).
: Checked and accepted by a Seshat Expert.
<
-
- {% autoescape off %}
- {% if obj.description %}
- {{ obj.description|make_references_look_nicer }}
-
- {% else %}
- -
- {% endif%}
- {% if obj.comment and obj.comment.id > 1 %}
- {{obj.comment }}
-
- {% endif %}
- {% endautoescape %}
+
+ Loading...
@@ -214,6 +196,23 @@ {{var_main_desc}}
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
+
+ document.addEventListener("DOMContentLoaded", function () {
+ document.querySelectorAll('.accordion-body').forEach(function (span) {
+ const objId = span.getAttribute('data-obj-id'); // Object ID
+ const modelName = span.getAttribute('data-model-name'); // Model name
+ fetch(`/get-description/${modelName}/${objId}/`) // Replace with your endpoint
+ .then(response => response.text())
+ .then(data => {
+ span.innerHTML = data; // Populate the span with the fetched content
+ })
+ .catch(error => {
+ console.error('Error loading content:', error);
+ span.innerHTML = "Failed to load content.";
+ });
+ });
+ });
+
{% endblock %}
diff --git a/seshat/apps/core/templates/core/list_base_wf.html b/seshat/apps/core/templates/core/list_base_wf.html
index 660613c3e..213e13a98 100644
--- a/seshat/apps/core/templates/core/list_base_wf.html
+++ b/seshat/apps/core/templates/core/list_base_wf.html
@@ -92,7 +92,7 @@
Expert?
- : Not yet Checked by a Seshat Expert.
: Checked and accepted by a Seshat Expert (or RA).
+ : Not yet Checked by a Seshat Expert.
: Checked and accepted by a Seshat Expert.
- {% else %} - - - {% endif%} - {% if obj.comment and obj.comment.id > 1 %} - {{obj.comment }} - - {% endif %} - {% endautoescape %} + + Loading...
{{var_main_desc}}
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) { return new bootstrap.Popover(popoverTriggerEl) }) + + document.addEventListener("DOMContentLoaded", function () { + document.querySelectorAll('.accordion-body').forEach(function (span) { + const objId = span.getAttribute('data-obj-id'); // Object ID + const modelName = span.getAttribute('data-model-name'); // Model name + fetch(`/get-description/${modelName}/${objId}/`) // Replace with your endpoint + .then(response => response.text()) + .then(data => { + span.innerHTML = data; // Populate the span with the fetched content + }) + .catch(error => { + console.error('Error loading content:', error); + span.innerHTML = "Failed to load content."; + }); + }); + }); + {% endblock %} diff --git a/seshat/apps/core/templates/core/list_base_wf.html b/seshat/apps/core/templates/core/list_base_wf.html index 660613c3e..213e13a98 100644 --- a/seshat/apps/core/templates/core/list_base_wf.html +++ b/seshat/apps/core/templates/core/list_base_wf.html @@ -92,7 +92,7 @@: Checked and accepted by a Seshat Expert (or RA).
: Checked and accepted by a Seshat Expert.
+ (Only visible to Selected Seshat Experts/RAs)
+ +
{% for value in values %}
-
-
+
+
{% if key == "Polity_suprapolity_relations" %}
@@ -1667,6 +1673,9 @@
View all such records
+
+ {% include "core/partials/_private_comment_inline.html" %}
+
{% if value.description %}
@@ -1759,6 +1768,9 @@
View all such records
+
+ {% include "core/partials/_private_comment_inline.html" %}
+
{% if value.description %}
@@ -1852,6 +1864,9 @@
View all such records
+
+ {% include "core/partials/_private_comment_inline.html" %}
+
{% if value.description %}
@@ -1944,6 +1959,9 @@
View all such records
+
+ {% include "core/partials/_private_comment_inline.html" %}
+
{% if value.description %}
@@ -2189,11 +2207,22 @@
{% include "core/partials/_year_block_value_inline_pt.html" %}
+
+
+ {% include "core/partials/_tag_value_inline.html" %}
+ {% include "core/partials/_disputed_value_inline.html" %}
+ {% include "core/partials/_uncertain_value_inline.html" %}
+ {% include "core/partials/_expert_checked_value_inline.html" %}
+
+
{% with my_app_name='crisisdb' %}
- {% include "core/partials/_abc_x.html" %}
+ {% include "core/partials/_abc.html" %}
{% endwith %}
+
+ {% include "core/partials/_private_comment_inline.html" %}
+
{% include "core/partials/_power_transitions_inline.html" %}
{% endfor %}
diff --git a/seshat/apps/core/templates/core/polity/polity_list_light.html b/seshat/apps/core/templates/core/polity/polity_list_light.html
index 5de96d40e..83b92891e 100644
--- a/seshat/apps/core/templates/core/polity/polity_list_light.html
+++ b/seshat/apps/core/templates/core/polity/polity_list_light.html
@@ -77,14 +77,48 @@
background: purple,
}
+ #loading-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent background */
+ backdrop-filter: blur(5px); /* Blur effect */
+ z-index: 9999;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ visibility: hidden; /* Initially hidden */
+ opacity: 0;
+ transition: visibility 0.2s, opacity 0.2s ease-in-out;
+ }
+
+ .spinner-container {
+ text-align: center;
+ font-size: 2rem;
+ color: #555;
+ }
+
+ #loading-overlay.active {
+ visibility: visible;
+ opacity: 1;
+ }
+
+
+
+
+ Loading...
+
+
Polities (light)
{% if user.is_authenticated and 'core.add_capital' in user.get_all_permissions %}
- See Progress in coding for Polities (heavy)
+ See Progress in coding for Polities (heavy)
{% endif %}
@@ -331,4 +365,18 @@ There are no Polities in t
{% endfor %}
+
{% endblock %}
diff --git a/seshat/apps/core/templates/core/seshatcomments/seshatcomment_update.html b/seshat/apps/core/templates/core/seshatcomments/seshatcomment_update.html
index 2a445faf0..7327ec953 100644
--- a/seshat/apps/core/templates/core/seshatcomments/seshatcomment_update.html
+++ b/seshat/apps/core/templates/core/seshatcomments/seshatcomment_update.html
@@ -9,6 +9,16 @@
{% block content %}
-
-
-
- Step 1: Insert the data
-
+
View all such records
@@ -1759,6 +1768,9 @@
View all such records
@@ -1852,6 +1864,9 @@
View all such records
@@ -1944,6 +1959,9 @@
View all such records
@@ -2189,11 +2207,22 @@
All existing Private Comments:
All existing Private Comments:
All existing Private Comments:
All existing Private Comments:
All existing Private Comments:
All existing Private Comments:
$(ctl).text(msg); return true; } + + function toggleButton() { + const checkbox = document.getElementById('id_verify'); + const button = document.getElementById('saveButton'); + button.style.display = checkbox.checked ? 'inline-block' : 'none'; + } {% endblock %} diff --git a/seshat/apps/core/templates/core/seshatcomments/seshatprivatecommentpart_update2.html b/seshat/apps/core/templates/core/seshatcomments/seshatprivatecommentpart_update2.html index f6cace739..a1aad05d8 100644 --- a/seshat/apps/core/templates/core/seshatcomments/seshatprivatecommentpart_update2.html +++ b/seshat/apps/core/templates/core/seshatcomments/seshatprivatecommentpart_update2.html @@ -35,7 +35,7 @@Notes and Citations {{ form.is_first_100|as_crispy_field }}
- You are a Seshat Expert; you can enter a fact.
+ You are a Seshat Researcher; you can insert a new record into the database.
{{ form.finalized|as_crispy_field }}
@@ -723,7 +723,7 @@
{% endif %}
diff --git a/seshat/apps/crisisdb/templates/crisisdb/crisis_consequence/crisis_consequence_form_heavy.html b/seshat/apps/crisisdb/templates/crisisdb/crisis_consequence/crisis_consequence_form_heavy.html
index 4e936280b..ca6039a73 100644
--- a/seshat/apps/crisisdb/templates/crisisdb/crisis_consequence/crisis_consequence_form_heavy.html
+++ b/seshat/apps/crisisdb/templates/crisisdb/crisis_consequence/crisis_consequence_form_heavy.html
@@ -731,7 +731,7 @@
Notes and Citations - +
Notes and Citations {{ form.is_first_100|as_crispy_field }}
- You are a Seshat Expert; you can enter a fact.
+ You are a Seshat Researcher; you can insert a new record into the database.
{{ form.finalized|as_crispy_field }}
@@ -740,7 +740,7 @@
{% endif %}
diff --git a/seshat/apps/crisisdb/templates/crisisdb/human_sacrifice/human_sacrifice_list_all.html b/seshat/apps/crisisdb/templates/crisisdb/human_sacrifice/human_sacrifice_list_all.html
index f0b18e251..1708ce963 100644
--- a/seshat/apps/crisisdb/templates/crisisdb/human_sacrifice/human_sacrifice_list_all.html
+++ b/seshat/apps/crisisdb/templates/crisisdb/human_sacrifice/human_sacrifice_list_all.html
@@ -72,7 +72,7 @@
Expert
-
+
diff --git a/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form.html b/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form.html
index 266e47022..406a78d4e 100644
--- a/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form.html
+++ b/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form.html
@@ -398,10 +398,10 @@
- {% if request.user.is_staff %}
+ {% if request.user.is_authenticated and 'core.add_capital' in request.user.get_all_permissions%}
- You are a Seshat Expert; you can enter a fact.
+ You are a Seshat Researcher; you can insert a new Record to the Database.
{{ form.finalized|as_crispy_field }}
@@ -410,7 +410,7 @@
{% endif %}
diff --git a/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form_heavy.html b/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form_heavy.html
index 92a683d9f..9bda5f360 100644
--- a/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form_heavy.html
+++ b/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_form_heavy.html
@@ -438,10 +438,10 @@
- {% if request.user.is_staff %}
+ {% if request.user.is_authenticated and 'core.add_capital' in request.user.get_all_permissions%}
- You are a Seshat Expert; you can enter a fact.
+ You are a Seshat Researcher; you can insert a new Record to the Database.
{{ form.finalized|as_crispy_field }}
@@ -450,7 +450,7 @@
{% endif %}
diff --git a/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_update.html b/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_update.html
index eff6fa5f9..a5310425a 100644
--- a/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_update.html
+++ b/seshat/apps/crisisdb/templates/crisisdb/power_transition/power_transition_update.html
@@ -420,10 +420,10 @@
- {% if request.user.is_staff %}
+ {% if request.user.is_authenticated and 'core.add_capital' in request.user.get_all_permissions%}
- You are a Seshat Expert; you can enter a fact.
+ You are a Seshat Researcher; you can insert a new Record to the Database.
{{ form.finalized|as_crispy_field }}
@@ -432,7 +432,7 @@
{% endif %}
diff --git a/seshat/apps/crisisdb/templatetags/custom_filters.py b/seshat/apps/crisisdb/templatetags/custom_filters.py
index 01ecc9a7f..16abc5f8f 100644
--- a/seshat/apps/crisisdb/templatetags/custom_filters.py
+++ b/seshat/apps/crisisdb/templatetags/custom_filters.py
@@ -3,6 +3,7 @@
from seshat.apps.rt.var_defs import swapped_dict
+from seshat.apps.accounts.models import Seshat_Expert # Update with the correct path to your Seshat_Expert model
register = template.Library()
@@ -219,38 +220,125 @@ def make_references_look_nicer(value):
@register.filter
def give_me_a_color(value):
light_colors = [
- '#e6b8af',
- '#f4cccc',
- '#fce5cd',
- '#fff2cc',
- '#d9ead3',
- '#d0e0e3',
- '#c9daf8',
- '#cfe2f3',
- '#d9d2e9',
- '#ead1dc',
- '#dd7e6b',
- '#ea9999',
- '#f9cb9c',
- '#ffe599',
- '#b6d7a8',
- '#a2c4c9',
- '#a4c2f4',
- '#9fc5e8',
- '#b4a7d6',
- '#d5a6bd',
- '#cc4125',
- '#e06666',
- '#f6b26b',
- '#ffd966',
- '#93c47d',
- '#76a5af',
- '#6d9eeb',
- '#6fa8dc',
- '#8e7cc3',
- '#c27ba0',
+ '#b86354', # Darker red tone of #e6b8af
+ '#cc6666', # Darker red tone of #f4cccc
+ '#d9a065', # Darker orange tone of #fce5cd
+ '#d6b656', # Darker yellow tone of #fff2cc
+ '#94b373', # Darker green tone of #d9ead3
+ '#6c8488', # Darker blue-gray tone of #d0e0e3
+ '#6a92d1', # Darker blue tone of #c9daf8
+ '#7292a6', # Darker gray-blue tone of #cfe2f3
+ '#8f78c3', # Darker purple tone of #d9d2e9
+ '#c35b7f', # Darker pink-purple tone of #ead1dc
+ '#a93d2b', # Darker orange-red tone of #dd7e6b
+ '#b85454', # Darker red tone of #ea9999
+ '#e09957', # Darker orange tone of #f9cb9c
+ '#d7b942', # Darker yellow tone of #ffe599
+ '#79a659', # Darker green tone of #b6d7a8
+ '#4e7476', # Darker teal tone of #a2c4c9
+ '#4a7bbf', # Darker blue tone of #a4c2f4
+ '#4e92b8', # Darker blue tone of #9fc5e8
+ '#6c5ba3', # Darker purple tone of #b4a7d6
+ '#a35f88', # Darker pink-purple tone of #d5a6bd
+ '#892f15', # Darker red tone of #cc4125
+ '#a73f3f', # Darker red tone of #e06666
+ '#b86b35', # Darker orange tone of #f6b26b
+ '#d6ac34', # Darker yellow tone of #ffd966
+ '#5d8e52', # Darker green tone of #93c47d
+ '#43696d', # Darker teal tone of #76a5af
+ '#3d64b3', # Darker blue tone of #6d9eeb
+ '#4176a5', # Darker blue tone of #6fa8dc
+ '#654da6', # Darker purple tone of #8e7cc3
+ '#8f5477', # Darker pink tone of #c27ba0
]
+
+ # light_colors = [
+ # '#e6b8af',
+ # '#f4cccc',
+ # '#fce5cd',
+ # '#fff2cc',
+ # '#d9ead3',
+ # '#d0e0e3',
+ # '#c9daf8',
+ # '#cfe2f3',
+ # '#d9d2e9',
+ # '#ead1dc',
+ # '#dd7e6b',
+ # '#ea9999',
+ # '#f9cb9c',
+ # '#ffe599',
+ # '#b6d7a8',
+ # '#a2c4c9',
+ # '#a4c2f4',
+ # '#9fc5e8',
+ # '#b4a7d6',
+ # '#d5a6bd',
+ # '#cc4125',
+ # '#e06666',
+ # '#f6b26b',
+ # '#ffd966',
+ # '#93c47d',
+ # '#76a5af',
+ # '#6d9eeb',
+ # '#6fa8dc',
+ # '#8e7cc3',
+ # '#c27ba0',
+ # ]
+
index = int(value) % 30
return light_colors[index]
+
+
+@register.filter
+def in_group(user, group_name):
+ """
+ Checks if a user is in a given group.
+ """
+ if user.is_authenticated:
+ return user.groups.filter(name=group_name).exists()
+ return False
+
+
+@register.filter
+def is_user_real(user):
+ """
+ Check if the username has an underscore and if the part after the underscore
+ matches the domain part of the email.
+
+ Args:
+ username (str): The username to check.
+ email (str): The email to check against.
+
+ Returns:
+ bool: True if the username is valid, False otherwise.
+ """
+ if "_" not in user.username or user.last_login:
+ return True # No underscore in username
+
+ # Split username and email
+ username_part_2 = user.username.split("_")[1]
+ email_domain = user.email.split("@")[1] # Get the part after '@' in the email
+
+ # if email_domain.startswith(username_part_2):
+ # return False
+ # Compare second part of username to email domain
+ return username_part_2 != email_domain.split(".")[0]
+
+@register.filter
+def textincludes(value, arg):
+ """Check if a string includes a given substring."""
+ if isinstance(value, str):
+ return arg in value
+ return False
+
+@register.filter
+def get_seshat_expert(user):
+ """
+ Custom filter to get the Seshat_Expert object associated with a user.
+ """
+ try:
+ return Seshat_Expert.objects.get(user=user).id
+ except Seshat_Expert.DoesNotExist:
+ return None
\ No newline at end of file
diff --git a/seshat/apps/crisisdb/urls.py b/seshat/apps/crisisdb/urls.py
index 290cff930..02b016a32 100644
--- a/seshat/apps/crisisdb/urls.py
+++ b/seshat/apps/crisisdb/urls.py
@@ -1,9 +1,18 @@
from .models import Human_sacrifice, External_conflict, Internal_conflict, External_conflict_side, Agricultural_population, Arable_land, Arable_land_per_farmer, Gross_grain_shared_per_agricultural_population, Net_grain_shared_per_agricultural_population, Surplus, Military_expense, Silver_inflow, Silver_stock, Total_population, Gdp_per_capita, Drought_event, Locust_event, Socioeconomic_turmoil_event, Crop_failure_event, Famine_event, Disease_outbreak, Us_violence, Us_location, Us_violence_subtype, Us_violence_data_source, Power_transition
+
+from .forms import Human_sacrificeForm, Power_transitionForm
+
from django.urls import path
from .views import confirm_delete_view, delete_object_view
from . import views
+from seshat.apps.general.views import dynamic_create_view, dynamic_detail_view, generic_list_view, dynamic_update_view, dynamic_update_view_old, generic_metadata_download, generic_download
+
+model_form_pairs_main = [
+ (Human_sacrifice, Human_sacrificeForm, 'human_sacrifice', 'human_sacrifice', 'Human Sacrifice', 'Religion and Normative Ideology', 'Human Sacrifice', 'crisisdb'),
+ (Power_transition, Power_transitionForm, 'power_transition', 'power_transition', 'Power Transition', 'Power Transitions', None, 'crisisdb'),
+ ]
model_form_pairs = [
(Us_location, 'us_location', ),
@@ -14,6 +23,9 @@
]
+
+
+
urlpatterns = [
path('vars/', views.QingVars, name='qing_vars'),
path('playground/', views.playground, name='playground'),
@@ -22,6 +34,109 @@
#path('fpl_all/', views.fpl_all,name="fpl_all"),
]
+
+
+#############
+#############
+# Create URL patterns dynamically for each model-class pair: UPDATE
+for model_class, form_class, x_name, coded_value, myvar, sec, subsec, db_section in model_form_pairs_main:
+ urlpatterns.append(
+ path(f'{x_name}/create/', dynamic_create_view, {
+ 'form_class': form_class,
+ 'x_name': x_name,
+ 'myvar': myvar,
+ 'coded_value': coded_value,
+ 'my_exp': '-',# sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ #'db_section': db_section,
+ }, name=f'{x_name}-create')
+ )
+ urlpatterns.append(
+ path(f'{x_name}/updatenew//', dynamic_update_view, {
+ 'form_class': form_class,
+ 'model_class': model_class,
+ 'x_name': x_name,
+ 'myvar': myvar,
+ 'coded_value': coded_value,
+ 'my_exp': '-',# sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ #'db_section': db_section,
+ 'delete_url_name': x_name + "-confirm-delete",
+ }, name=f'{x_name}-updatenew')
+ )
+ urlpatterns.append(
+ path(f'{x_name}/update_old//', dynamic_update_view_old, {
+ 'form_class': form_class,
+ 'model_class': model_class,
+ 'x_name': x_name,
+ 'myvar': myvar,
+ 'coded_value': coded_value,
+ 'my_exp': '-',# sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ #'db_section': db_section,
+ 'delete_url_name': x_name + "-confirm-delete",
+ }, name=f'{x_name}-update')
+ )
+ urlpatterns.append(
+ path(f'{x_name}//', dynamic_detail_view, {
+ 'model_class': model_class,
+ 'myvar': x_name,
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ 'db_section': db_section,
+ 'var_name_display': myvar,
+ }, name=f'{x_name}-detail')
+ )
+ if coded_value == 'human_sacrifice':
+ urlpatterns.append(
+ path(f'{x_name}s_all/', generic_list_view, {
+ 'model_class': model_class,
+ 'var_name': x_name,
+ 'coded_value': coded_value,
+ 'var_name_display': myvar,
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ #'db_section': db_section,
+ 'var_main_desc': '-',# sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
+
+ }, name=f'{x_name}s_all')
+ )
+ urlpatterns.append(
+ path(f'{x_name}//confirm-delete/', confirm_delete_view, {
+ 'model_class': model_class,
+ 'var_name': x_name,
+ }, name=f'{x_name}-confirm-delete')
+ )
+ urlpatterns.append(
+ path(f'{x_name}//delete/', delete_object_view, {
+ 'model_class': model_class,
+ 'var_name': x_name,
+ }, name=f'{x_name}-delete')
+ )
+ urlpatterns.append(
+ path(f'{x_name}download/', generic_download, {
+ 'model_class': model_class,
+ 'var_name': x_name,
+ }, name=f'{x_name}-download')
+ )
+ urlpatterns.append(
+ path(f'{x_name}metadownload/', generic_metadata_download, {
+ 'var_name': x_name,
+ 'var_name_display': myvar,
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ #'db_section': db_section,
+ 'var_main_desc': '-',# sc_var_defs[x_name],
+ }, name=f'{x_name}-metadownload')
+ )
+
+
+
+
+
urlpatterns += [
path('us_locations/', views.UsLocationListView.as_view(), name='us_location_list'),
path('us_locations/create/', views.UsLocationCreateView.as_view(), name='us_location_create'),
@@ -100,10 +215,10 @@
path('power_transitions/', views.Power_transitionListView.as_view(), name='power_transitions'),
path('power_transitions_list_all/', views.Power_transitionListViewAll.as_view(), name='power_transition_list'),
path('power_transitions_all/', views.Power_transitionListViewAll.as_view(), name='power_transitions_all'),
- path('power_transition/', views.Power_transitionDetailView.as_view(),
- name='power_transition-detail'),
- path('power_transition//update/',
- views.Power_transitionUpdate.as_view(), name="power_transition-update"),
+# path('power_transition/', views.Power_transitionDetailView.as_view(),
+# name='power_transition-detail'),
+# path('power_transition//update/',
+# views.Power_transitionUpdate.as_view(), name="power_transition-update"),
path('power_transition//updateheavy/',
views.Power_transitionUpdateHeavy.as_view(), name="power_transition-update_heavy"),
#path('power_transition//delete/',
@@ -117,26 +232,26 @@
]
-urlpatterns += [
- path('human_sacrifice/create/', views.Human_sacrificeCreate.as_view(),
- name="human_sacrifice-create"),
-
- path('human_sacrifices/', views.Human_sacrificeListView.as_view(), name='human_sacrifices'),
- path('human_sacrifices_all/', views.Human_sacrificeListViewAll.as_view(), name='human_sacrifices_all'),
- path('human_sacrifice/', views.Human_sacrificeDetailView.as_view(),
- name='human_sacrifice-detail'),
- path('human_sacrifice//update/',
- views.Human_sacrificeUpdate.as_view(), name="human_sacrifice-update"),
- path('human_sacrifice//delete/',
- views.Human_sacrificeDelete.as_view(), name="human_sacrifice-delete"),
- # Download
- path('human_sacrificedownload/', views.human_sacrifice_download,
- name="human_sacrifice-download"),
- path('human_sacrificemetadownload/', views.human_sacrifice_meta_download,
- name="human_sacrifice-metadownload"),
- path('create_subcomment//', views.create_a_comment_with_a_subcomment, name='create_subcomment'),
-
-]
+# urlpatterns += [
+# path('human_sacrifice/create/', views.Human_sacrificeCreate.as_view(),
+# name="human_sacrifice-create"),
+
+# path('human_sacrifices/', views.Human_sacrificeListView.as_view(), name='human_sacrifices'),
+# path('human_sacrifices_all/', views.Human_sacrificeListViewAll.as_view(), name='human_sacrifices_all'),
+# path('human_sacrifice/', views.Human_sacrificeDetailView.as_view(),
+# name='human_sacrifice-detail'),
+# path('human_sacrifice//update/',
+# views.Human_sacrificeUpdate.as_view(), name="human_sacrifice-update"),
+# path('human_sacrifice//delete/',
+# views.Human_sacrificeDelete.as_view(), name="human_sacrifice-delete"),
+# # Download
+# path('human_sacrificedownload/', views.human_sacrifice_download,
+# name="human_sacrifice-download"),
+# path('human_sacrificemetadownload/', views.human_sacrifice_meta_download,
+# name="human_sacrifice-metadownload"),
+# path('create_subcomment//', views.create_a_comment_with_a_subcomment, name='create_subcomment'),
+
+# ]
urlpatterns += [
diff --git a/seshat/apps/crisisdb/views.py b/seshat/apps/crisisdb/views.py
index ada8aeda9..7136c52ac 100644
--- a/seshat/apps/crisisdb/views.py
+++ b/seshat/apps/crisisdb/views.py
@@ -802,16 +802,13 @@ def get_context_data(self, **kwargs):
return context
-class Power_transitionListViewAll(PermissionRequiredMixin, generic.ListView):
+class Power_transitionListViewAll(generic.ListView):
"""
View for listing all Power_transition instances.
-
- Note:
- This view is only accessible to users with the 'add_capital' permission.
"""
model = Power_transition
template_name = "crisisdb/power_transition/power_transition_list_all_new.html"
- permission_required = 'core.add_capital'
+ #permission_required = 'core.add_capital'
#paginate_by = 50
def get_absolute_url(self):
@@ -858,6 +855,9 @@ def get_queryset(self):
'polity_end_year': 2000,
'trans_list': []
}
+ has_description = False
+ if transition.description:
+ has_description = True
pols_dict[polity_id]['trans_list'].append({
'year_from': transition.year_from,
@@ -866,8 +866,6 @@ def get_queryset(self):
'successor': transition.successor,
'name': transition.name,
'trans_id': transition.id,
-
-
'overturn': transition.overturn,
'predecessor_assassination': transition.predecessor_assassination,
'intra_elite': transition.intra_elite,
@@ -876,6 +874,7 @@ def get_queryset(self):
'separatist_rebellion': transition.separatist_rebellion,
'external_invasion': transition.external_invasion,
'external_interference': transition.external_interference,
+ 'has_description': has_description,
})
#print(grouped_dict)
@@ -1317,7 +1316,7 @@ def create_a_comment_with_a_subcomment(request, hs_instance_id):
Upon calling this function, I want to create a subcomment and assign it to a comment and then assign the comment to the model_name with id=hs_instance_id.
"""
# Create a new comment instance and save it to the database
- comment_instance = SeshatComment.objects.create(text='a new_comment_text')
+ comment_instance = SeshatComment.objects.create(text='')
user_logged_in = request.user
# Get the Seshat_Expert instance associated with the user
diff --git a/seshat/apps/general/forms.py b/seshat/apps/general/forms.py
index 6e0fbd17f..bfc26e464 100644
--- a/seshat/apps/general/forms.py
+++ b/seshat/apps/general/forms.py
@@ -1,4 +1,6 @@
from .models import Polity_research_assistant, Polity_utm_zone, Polity_original_name, Polity_alternative_name, Polity_peak_years, Polity_duration, Polity_degree_of_centralization, Polity_suprapolity_relations, Polity_capital, Polity_language, Polity_linguistic_family, Polity_language_genus, Polity_religion_genus, Polity_religion_family, Polity_religion, Polity_relationship_to_preceding_entity, Polity_preceding_entity, Polity_succeeding_entity, Polity_supracultural_entity, Polity_scale_of_supracultural_interaction, Polity_alternate_religion_genus, Polity_alternate_religion_family, Polity_alternate_religion, Polity_expert, Polity_editor, Polity_religious_tradition
+
+from seshat.apps.accounts.models import Seshat_Expert
import datetime
from django import forms
@@ -12,39 +14,73 @@
from django.template.defaulttags import register
+
+
+class ExpertReviewedForm(forms.ModelForm):
+ # expert_reviewed_by_me = forms.BooleanField(
+ # widget=forms.CheckboxInput(attrs={'class': 'mb-3'}),
+ # label="Expert Reviewed By ME.",
+ # initial=False, # Default value is False
+ # required=False # Make it optional if needed
+ # )
+ # expert_reviewed = forms.BooleanField(
+ # widget=forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': False}),
+ # label="Expert Reviewed!",
+ # initial=False, # Default value is False
+ # required=False, # Make it optional if needed
+ # disabled=True
+ # )
+
+ def __init__(self, *args, **kwargs):
+ # user = kwargs.pop('user', None) # Pop the user from kwargs
+ # print(user)
+ super().__init__(*args, **kwargs)
+ self.fields['suggested_expert'] = forms.ModelMultipleChoiceField(
+ queryset=Seshat_Expert.objects.filter(role='Seshat Expert'),
+ widget=forms.SelectMultiple(attrs={
+ 'class': 'form-control mb-3 js-states js-example-basic-multiple',
+ 'text':'suggested_experts[]',
+ 'data-select2-id': 'select2-data-id_suggested_expert'
+ }),
+ label="My Suggested Seshat Experts ", # Updated label
+ required=False
+ )
+
+ # def clean_expert_reviewed(self):
+ # # Explicitly set the value to False
+ # return False
+
+
commonlabels = {
'year_from': 'Start Year',
'year_to': 'End Year',
'tag': 'Confidence Level',
"is_disputed" : "Dispute?",
"is_uncertain" : "Uncertainty?",
- "expert_reviewed" : "Expert Checked?",
"drb_reviewed" : " Data Review Board Reviewed?",
'citations': 'Add one or more Citations',
'finalized': 'This piece of data is verified.',
}
commonfields = ['polity', 'year_from', 'year_to',
- 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
+ 'description', 'tag', 'is_disputed', 'is_uncertain', 'drb_reviewed', 'finalized', 'citations']
commonwidgets = {
'polity': forms.Select(attrs={'class': 'form-control mb-1 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}),
'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
- 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 200px', 'placeholder':'Add a meaningful description (optional)'}),
+ 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 240px; line-height: 1.2;', 'placeholder':'Add a meaningful description (optional)\nNote: Use §REF§ opening and closing tags to include citations to the description.\nExample: §REF§Chadwick, J. 1976. The Mycenaean World, Cambridge, p.78.§REF§.'}),
'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
'tag': forms.RadioSelect(),
- "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+ "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3',}),
"is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
"drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
}
-# class ExpertReviewedForm(forms.ModelForm):
-# expert_reviewed_by_me = forms.BooleanField(required=False, label="Expert Reviewed by Me")
-class Polity_research_assistantForm(forms.ModelForm):
+
+class Polity_research_assistantForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_research_assistant model.
"""
@@ -61,7 +97,7 @@ class Meta:
widgets['polity_ra'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_utm_zoneForm(forms.ModelForm):
+class Polity_utm_zoneForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_utm_zone model.
"""
@@ -78,7 +114,7 @@ class Meta:
widgets['utm_zone'] = forms.TextInput(attrs={'class': 'form-control mb-3', })
-class Polity_original_nameForm(forms.ModelForm):
+class Polity_original_nameForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_original_name model.
"""
@@ -95,7 +131,7 @@ class Meta:
widgets['original_name'] = forms.TextInput(attrs={'class': 'form-control mb-3', })
-class Polity_alternative_nameForm(forms.ModelForm):
+class Polity_alternative_nameForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_alternative_name model.
"""
@@ -112,7 +148,7 @@ class Meta:
widgets['alternative_name'] = forms.TextInput(attrs={'class': 'form-control mb-3', })
-class Polity_peak_yearsForm(forms.ModelForm):
+class Polity_peak_yearsForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_peak_years model.
"""
@@ -138,7 +174,7 @@ class Meta:
-class Polity_durationForm(forms.ModelForm):
+class Polity_durationForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_duration model.
"""
@@ -161,7 +197,7 @@ class Meta:
widgets['polity_year_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Polity_degree_of_centralizationForm(forms.ModelForm):
+class Polity_degree_of_centralizationForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_degree_of_centralization model.
"""
@@ -178,7 +214,7 @@ class Meta:
widgets['degree_of_centralization'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_suprapolity_relationsForm(forms.ModelForm):
+class Polity_suprapolity_relationsForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_suprapolity_relations model.
"""
@@ -198,7 +234,7 @@ class Meta:
widgets['other_polity'] = forms.Select(attrs={'class': 'form-control mb-4 pb-4 js-example-basic-single', 'id': 'id_other_polity', 'name': 'other_polity'})
-class Polity_capitalForm(forms.ModelForm):
+class Polity_capitalForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_capital model.
"""
@@ -222,7 +258,7 @@ class Meta:
-class Polity_languageForm(forms.ModelForm):
+class Polity_languageForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_language model.
"""
@@ -239,7 +275,7 @@ class Meta:
widgets['language'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_linguistic_familyForm(forms.ModelForm):
+class Polity_linguistic_familyForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_linguistic_family model.
"""
@@ -256,7 +292,7 @@ class Meta:
widgets['linguistic_family'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_language_genusForm(forms.ModelForm):
+class Polity_language_genusForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_language_genus model.
"""
@@ -273,7 +309,7 @@ class Meta:
widgets['language_genus'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_religion_genusForm(forms.ModelForm):
+class Polity_religion_genusForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_religion_genus model.
"""
@@ -290,7 +326,7 @@ class Meta:
widgets['religion_genus'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_religion_familyForm(forms.ModelForm):
+class Polity_religion_familyForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_religion_family model.
"""
@@ -307,7 +343,7 @@ class Meta:
widgets['religion_family'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_religionForm(forms.ModelForm):
+class Polity_religionForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_religion model.
"""
@@ -324,7 +360,7 @@ class Meta:
widgets['religion'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_relationship_to_preceding_entityForm(forms.ModelForm):
+class Polity_relationship_to_preceding_entityForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_relationship_to_preceding_entity model.
"""
@@ -341,7 +377,7 @@ class Meta:
widgets['relationship_to_preceding_entity'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_preceding_entityForm(forms.ModelForm):
+class Polity_preceding_entityForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_preceding_entity model.
"""
@@ -368,7 +404,7 @@ class Meta:
widgets['other_polity'] = forms.Select(attrs={'class': 'form-control mb-4 pb-4 js-example-basic-single', 'id': 'id_other_polity', 'name': 'other_polity'})
-class Polity_succeeding_entityForm(forms.ModelForm):
+class Polity_succeeding_entityForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_succeeding_entity model.
"""
@@ -387,7 +423,7 @@ class Meta:
widgets['succeeding_entity'] = forms.TextInput(attrs={'class': 'form-control mb-3', })
-class Polity_supracultural_entityForm(forms.ModelForm):
+class Polity_supracultural_entityForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_supracultural_entity model.
"""
@@ -404,7 +440,7 @@ class Meta:
widgets['supracultural_entity'] = forms.TextInput(attrs={'class': 'form-control mb-3', })
-class Polity_scale_of_supracultural_interactionForm(forms.ModelForm):
+class Polity_scale_of_supracultural_interactionForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_scale_of_supracultural_interaction model.
"""
@@ -423,7 +459,7 @@ class Meta:
widgets['scale_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Polity_alternate_religion_genusForm(forms.ModelForm):
+class Polity_alternate_religion_genusForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_alternate_religion_genus model.
"""
@@ -440,7 +476,7 @@ class Meta:
widgets['alternate_religion_genus'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_alternate_religion_familyForm(forms.ModelForm):
+class Polity_alternate_religion_familyForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_alternate_religion_family model.
"""
@@ -457,7 +493,7 @@ class Meta:
widgets['alternate_religion_family'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_alternate_religionForm(forms.ModelForm):
+class Polity_alternate_religionForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_alternate_religion model.
"""
@@ -474,7 +510,7 @@ class Meta:
widgets['alternate_religion'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_expertForm(forms.ModelForm):
+class Polity_expertForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_expert model.
"""
@@ -491,7 +527,7 @@ class Meta:
widgets['expert'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_editorForm(forms.ModelForm):
+class Polity_editorForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_editor model.
"""
@@ -508,7 +544,7 @@ class Meta:
widgets['editor'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_religious_traditionForm(forms.ModelForm):
+class Polity_religious_traditionForm(ExpertReviewedForm):
"""
Form for creating and updating Polity_religious_tradition model.
"""
diff --git a/seshat/apps/general/migrations/0020_alter_polity_alternate_religion_comment_and_more.py b/seshat/apps/general/migrations/0020_alter_polity_alternate_religion_comment_and_more.py
new file mode 100644
index 000000000..aa233190f
--- /dev/null
+++ b/seshat/apps/general/migrations/0020_alter_polity_alternate_religion_comment_and_more.py
@@ -0,0 +1,145 @@
+# Generated by Django 4.0.3 on 2024-12-06 18:51
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('core', '0068_rename_videoshapefile_cliopatria'),
+ ('general', '0019_alter_polity_alternate_religion_alternate_religion_and_more'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='polity_alternate_religion',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_alternate_religion_family',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_alternate_religion_genus',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_alternative_name',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_capital',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_degree_of_centralization',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_duration',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_editor',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_expert',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_language',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_language_genus',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_linguistic_family',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_original_name',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_peak_years',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_preceding_entity',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_relationship_to_preceding_entity',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_religion',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_religion_family',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_religion_genus',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_religious_tradition',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_research_assistant',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_scale_of_supracultural_interaction',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_succeeding_entity',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_supracultural_entity',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_suprapolity_relations',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_utm_zone',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ ]
diff --git a/seshat/apps/general/urls.py b/seshat/apps/general/urls.py
index aeebd2870..7f68dec92 100644
--- a/seshat/apps/general/urls.py
+++ b/seshat/apps/general/urls.py
@@ -535,29 +535,29 @@
#####################
model_form_pairs = [
-(Polity_utm_zone, Polity_utm_zoneForm, 'polity_utm_zone', 'utm_zone', 'Polity Utm Zone', 'Identity and Location', None),
-(Polity_original_name, Polity_original_nameForm, 'polity_original_name', 'original_name', 'Polity Original Name', 'Identity and Location', None),
-(Polity_alternative_name, Polity_alternative_nameForm, 'polity_alternative_name', 'alternative_name', 'Polity Alternative Name', 'Identity and Location', None),
-(Polity_peak_years, Polity_peak_yearsForm, 'polity_peak_years', 'peak_years', 'Polity Peak Years', 'Temporal Bounds', None),
-(Polity_duration, Polity_durationForm, 'polity_duration', 'duration', 'Polity Duration', 'Temporal Bounds', None),
-(Polity_degree_of_centralization, Polity_degree_of_centralizationForm, 'polity_degree_of_centralization', 'degree_of_centralization', 'Polity Degree Of Centralization', 'Political and Cultural Relations', None),
-(Polity_suprapolity_relations, Polity_suprapolity_relationsForm, 'polity_suprapolity_relations', 'suprapolity_relations', 'Polity Suprapolity Relations', 'Language', None),
-(Polity_capital, Polity_capitalForm, 'polity_capital', 'capital', 'Polity Capital', 'Identity and Location', None),
-(Polity_language, Polity_languageForm, 'polity_language', 'language', 'Polity Language', 'Language', None),
-(Polity_linguistic_family, Polity_linguistic_familyForm, 'polity_linguistic_family', 'linguistic_family', 'Polity Linguistic Family', 'Language', None),
-(Polity_language_genus, Polity_language_genusForm, 'polity_language_genus', 'language_genus', 'Polity Language Genus', 'Language', None),
-(Polity_religion_genus, Polity_religion_genusForm, 'polity_religion_genus', 'religion_genus', 'Polity Religion Genus', 'Religion', None),
-(Polity_religion_family, Polity_religion_familyForm, 'polity_religion_family', 'religion_family', 'Polity Religion Family', 'Religion', None),
-(Polity_religion, Polity_religionForm, 'polity_religion', 'religion', 'Polity Religion', 'Religion', None),
-(Polity_relationship_to_preceding_entity, Polity_relationship_to_preceding_entityForm, 'polity_relationship_to_preceding_entity', 'relationship_to_preceding_entity', 'Polity Relationship To Preceding Entity', 'Political and Cultural Relations', None),
-(Polity_preceding_entity, Polity_preceding_entityForm, 'polity_preceding_entity', 'preceding_entity', 'Polity Preceding Entity', 'Political and Cultural Relations', None),
-(Polity_succeeding_entity, Polity_succeeding_entityForm, 'polity_succeeding_entity', 'succeeding_entity', 'Polity Succeeding Entity', 'Political and Cultural Relations', None),
-(Polity_supracultural_entity, Polity_supracultural_entityForm, 'polity_supracultural_entity', 'supracultural_entity', 'Polity Supracultural Entity', 'Political and Cultural Relations', None),
-(Polity_scale_of_supracultural_interaction, Polity_scale_of_supracultural_interactionForm, 'polity_scale_of_supracultural_interaction', 'scale_of_supracultural_interaction', 'Polity Scale Of Supracultural Interaction', 'Political and Cultural Relations', None),
-(Polity_alternate_religion_genus, Polity_alternate_religion_genusForm, 'polity_alternate_religion_genus', 'alternate_religion_genus', 'Polity Alternate Religion Genus', 'Religion', None),
-(Polity_alternate_religion_family, Polity_alternate_religion_familyForm, 'polity_alternate_religion_family', 'alternate_religion_family', 'Polity Alternate Religion Family', 'Religion', None),
-(Polity_alternate_religion, Polity_alternate_religionForm, 'polity_alternate_religion', 'alternate_religion', 'Polity Alternate Religion', 'Religion', None),
-(Polity_religious_tradition, Polity_religious_traditionForm, 'polity_religious_tradition', 'religious_tradition', 'Polity Religious Tradition', 'Religion', None),
+(Polity_utm_zone, Polity_utm_zoneForm, 'polity_utm_zone', 'utm_zone', 'Polity Utm Zone', 'Identity and Location', None, 'general'),
+(Polity_original_name, Polity_original_nameForm, 'polity_original_name', 'original_name', 'Polity Original Name', 'Identity and Location', None, 'general'),
+(Polity_alternative_name, Polity_alternative_nameForm, 'polity_alternative_name', 'alternative_name', 'Polity Alternative Name', 'Identity and Location', None, 'general'),
+(Polity_peak_years, Polity_peak_yearsForm, 'polity_peak_years', 'peak_years', 'Polity Peak Years', 'Temporal Bounds', None, 'general'),
+(Polity_duration, Polity_durationForm, 'polity_duration', 'duration', 'Polity Duration', 'Temporal Bounds', None, 'general'),
+(Polity_degree_of_centralization, Polity_degree_of_centralizationForm, 'polity_degree_of_centralization', 'degree_of_centralization', 'Polity Degree Of Centralization', 'Political and Cultural Relations', None, 'general'),
+(Polity_suprapolity_relations, Polity_suprapolity_relationsForm, 'polity_suprapolity_relations', 'suprapolity_relations', 'Polity Suprapolity Relations', 'Language', None, 'general'),
+(Polity_capital, Polity_capitalForm, 'polity_capital', 'capital', 'Polity Capital', 'Identity and Location', None, 'general'),
+(Polity_language, Polity_languageForm, 'polity_language', 'language', 'Polity Language', 'Language', None, 'general'),
+(Polity_linguistic_family, Polity_linguistic_familyForm, 'polity_linguistic_family', 'linguistic_family', 'Polity Linguistic Family', 'Language', None, 'general'),
+(Polity_language_genus, Polity_language_genusForm, 'polity_language_genus', 'language_genus', 'Polity Language Genus', 'Language', None, 'general'),
+(Polity_religion_genus, Polity_religion_genusForm, 'polity_religion_genus', 'religion_genus', 'Polity Religion Genus', 'Religion', None, 'general'),
+(Polity_religion_family, Polity_religion_familyForm, 'polity_religion_family', 'religion_family', 'Polity Religion Family', 'Religion', None, 'general'),
+(Polity_religion, Polity_religionForm, 'polity_religion', 'religion', 'Polity Religion', 'Religion', None, 'general'),
+(Polity_relationship_to_preceding_entity, Polity_relationship_to_preceding_entityForm, 'polity_relationship_to_preceding_entity', 'relationship_to_preceding_entity', 'Polity Relationship To Preceding Entity', 'Political and Cultural Relations', None, 'general'),
+(Polity_preceding_entity, Polity_preceding_entityForm, 'polity_preceding_entity', 'preceding_entity', 'Polity Preceding Entity', 'Political and Cultural Relations', None, 'general'),
+(Polity_succeeding_entity, Polity_succeeding_entityForm, 'polity_succeeding_entity', 'succeeding_entity', 'Polity Succeeding Entity', 'Political and Cultural Relations', None, 'general'),
+(Polity_supracultural_entity, Polity_supracultural_entityForm, 'polity_supracultural_entity', 'supracultural_entity', 'Polity Supracultural Entity', 'Political and Cultural Relations', None, 'general'),
+(Polity_scale_of_supracultural_interaction, Polity_scale_of_supracultural_interactionForm, 'polity_scale_of_supracultural_interaction', 'scale_of_supracultural_interaction', 'Polity Scale Of Supracultural Interaction', 'Political and Cultural Relations', None, 'general'),
+(Polity_alternate_religion_genus, Polity_alternate_religion_genusForm, 'polity_alternate_religion_genus', 'alternate_religion_genus', 'Polity Alternate Religion Genus', 'Religion', None, 'general'),
+(Polity_alternate_religion_family, Polity_alternate_religion_familyForm, 'polity_alternate_religion_family', 'alternate_religion_family', 'Polity Alternate Religion Family', 'Religion', None, 'general'),
+(Polity_alternate_religion, Polity_alternate_religionForm, 'polity_alternate_religion', 'alternate_religion', 'Polity Alternate Religion', 'Religion', None, 'general'),
+(Polity_religious_tradition, Polity_religious_traditionForm, 'polity_religious_tradition', 'religious_tradition', 'Polity Religious Tradition', 'Religion', None, 'general'),
]
@@ -570,7 +570,7 @@
# Create URL patterns dynamically for each model-class pair: UPDATE
-for model_class, form_class, x_name, coded_value, myvar, sec, subsec in model_form_pairs:
+for model_class, form_class, x_name, coded_value, myvar, sec, subsec, db_section in model_form_pairs:
urlpatterns.append(
path(f'{x_name}/create/', views.dynamic_create_view, {
'form_class': form_class,
@@ -615,6 +615,7 @@
'var_name_display': myvar,
'var_section': sec,
'var_subsection': subsec,
+ 'db_section': db_section,
}, name=f'{x_name}-detail')
)
urlpatterns.append(
diff --git a/seshat/apps/general/views.py b/seshat/apps/general/views.py
index 229d3ff84..eec0eb574 100644
--- a/seshat/apps/general/views.py
+++ b/seshat/apps/general/views.py
@@ -12,7 +12,7 @@
from django.views.generic.edit import CreateView, UpdateView, DeleteView
-from ..core.models import Citation, Reference, Polity, Section, Subsection, Country, Variablehierarchy
+from ..core.models import Citation, Reference, Polity, Section, Subsection, Country, Variablehierarchy, SeshatPrivateComment, SeshatPrivateCommentPart
from seshat.apps.accounts.models import Seshat_Expert
@@ -7664,7 +7664,7 @@ def send_test_email():
@login_required
@permission_required('core.add_capital', raise_exception=True)
@user_passes_test(has_add_capital_permission, login_url='permission_denied')
-def dynamic_detail_view(request, pk, model_class, myvar, var_name_display, var_section, var_subsection,):
+def dynamic_detail_view(request, pk, model_class, myvar, var_name_display, var_section, var_subsection, db_section):
# Retrieve the object for the given model class
#import time
#start_time = time.time()
@@ -7679,7 +7679,7 @@ def dynamic_detail_view(request, pk, model_class, myvar, var_name_display, var_s
'see_all_url': myvar+"s_all",
'letsdo': 'Let us do it!!!',
'form': form_inline_new,
- 'db_section': 'general',
+ 'db_section': db_section,
'var_section': var_section,
'var_subsection': var_subsection,
}
@@ -7688,6 +7688,9 @@ def dynamic_detail_view(request, pk, model_class, myvar, var_name_display, var_s
return render(request, 'core/generic_templates/generic_detail.html', context)
+
+
+
# Use the login_required, permission_required, and user_passes_test decorators
@login_required
@permission_required('core.add_capital', raise_exception=True)
@@ -7696,8 +7699,15 @@ def dynamic_create_view(request, form_class, x_name, coded_value, myvar, my_exp,
x_name_1 = x_name
x_name_2 = None
x_name_3 = None
-
- if coded_value == 'duration':
+
+ if coded_value == "power_transition":
+ x_name_1, x_name_2, x_name_3, x_name_4, x_name_5, x_name_6, x_name_7, x_name_8, x_name_9, x_name_10, x_name_11, x_name_12, x_name_13, x_name_14 = 'name', 'predecessor', 'successor', 'contested', 'overturn', 'predecessor_assassination', 'intra_elite', 'military_revolt', 'popular_uprising', 'separatist_rebellion', 'external_invasion', 'external_interference', 'drb_reviewed', 'description'
+ elif coded_value == "widespread_religion":
+ x_name_1, x_name_2, x_name_3 = "order", "widespread_religion", "degree_of_prevalence"
+ elif coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall']:
+ x_name_with_from = f'{x_name}_from'
+ x_name_with_to = f'{x_name}_to'
+ elif coded_value == 'duration':
x_name_with_from = 'polity_year_from'
x_name_with_to = 'polity_year_to'
elif coded_value == 'peak_years':
@@ -7713,8 +7723,37 @@ def dynamic_create_view(request, form_class, x_name, coded_value, myvar, my_exp,
if my_form.is_valid():
# print(f"ZARAGOOOOOOOOOOOZA (NEW): {my_form.cleaned_data['expert_reviewed_by_me']}.")
# my_form.instance.expert_reviewed = my_form.cleaned_data['expert_reviewed_by_me']
+ logged_in_user = request.user
+ new_object = my_form.save(commit=False)
+ suggested_experts = my_form.cleaned_data['suggested_expert'] # Adjust the field name
+ #is_reviewed_by_me = my_form.cleaned_data['expert_reviewed_by_me'] # Adjust the field name
+ try:
+ logged_in_expert = Seshat_Expert.objects.get(user=logged_in_user)
+ except:
+ logged_in_expert = None
+
+
+ if suggested_experts:
+ # create a Prvate Comment to attach parts to it:
+ father_private_comment = SeshatPrivateComment.objects.create(text="")
+ new_object.private_comment = father_private_comment
+ seshat_private_comment_part = SeshatPrivateCommentPart(
+ private_comment_part_text=f"I have coded a new record for the variable '{new_object.name}' on the polity: '{new_object.polity}'. I would appreciate it if you could review it.",
+ private_comment_owner=logged_in_expert,
+ private_comment= father_private_comment
+ )
+
+ print("####################", new_object)
+
+ seshat_private_comment_part.save()
+
+ seshat_private_comment_part.private_comment_reader.add(*suggested_experts)
+
+ new_object.expert_reviewed = False
+ new_object.save() # Save the object to persist the association
+
+
- new_object = my_form.save()
action = request.POST.get('action')
if action == 'redirect_one':
return redirect("polity-detail-main", pk=new_object.polity.id)
@@ -7732,8 +7771,6 @@ def dynamic_create_view(request, form_class, x_name, coded_value, myvar, my_exp,
# print("Alllllllloooooooooooooooo: ", logged_in_user)
# new_object.curator.add(seshat_expert_instance)
- #return redirect('seshat-index')
- return redirect(f"{x_name}-detail", pk=new_object.id) # Replace 'success_url_name' with your success URL
else:
polity_id_x = request.GET.get('polity_id_x')
my_form = form_class(initial= {'polity': polity_id_x,})
@@ -7748,12 +7785,43 @@ def dynamic_create_view(request, form_class, x_name, coded_value, myvar, my_exp,
"my_exp": my_exp,
#'expert_reviewed_by_me': my_form['expert_reviewed_by_me']
}
- if coded_value in ['preceding_entity']:
+
+
+ if coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall']:
+ context.update({
+ 'extra_var': my_form[x_name_with_from],
+ 'extra_var2': my_form[x_name_with_to],
+ })
+ elif coded_value in ['preceding_entity']:
context.update({
'extra_var': my_form['other_polity'],
'extra_var2': my_form['merged_old_data'],
'extra_var3': my_form['relationship_to_preceding_entity'],
})
+ elif coded_value in ['widespread_religion']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ })
+ elif coded_value in ['power_transition']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ 'extra_var4': my_form[x_name_4],
+ 'extra_var5': my_form[x_name_5],
+ 'extra_var6': my_form[x_name_6],
+ 'extra_var7': my_form[x_name_7],
+ 'extra_var8': my_form[x_name_8],
+ 'extra_var9': my_form[x_name_9],
+ 'extra_var10': my_form[x_name_10],
+ 'extra_var11': my_form[x_name_11],
+ 'extra_var12': my_form[x_name_12],
+ 'extra_var13': my_form[x_name_13],
+ 'extra_var14': my_form[x_name_14],
+
+ })
elif coded_value in ['suprapolity_relations']:
context.update({
'extra_var': my_form['supra_polity_relations'],
@@ -7786,7 +7854,14 @@ def dynamic_update_view_old(request, object_id, form_class, model_class, x_name,
# Retrieve the object based on the object_id
my_object = model_class.objects.get(id=object_id)
- if coded_value == 'duration':
+ if coded_value == "power_transition":
+ x_name_1, x_name_2, x_name_3, x_name_4, x_name_5, x_name_6, x_name_7, x_name_8, x_name_9, x_name_10, x_name_11, x_name_12, x_name_13, x_name_14 = 'name', 'predecessor', 'successor', 'contested', 'overturn', 'predecessor_assassination', 'intra_elite', 'military_revolt', 'popular_uprising', 'separatist_rebellion', 'external_invasion', 'external_interference', 'drb_reviewed', 'description'
+ elif coded_value == "widespread_religion":
+ x_name_1, x_name_2, x_name_3 = "order", "widespread_religion", "degree_of_prevalence"
+ elif coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall' ]:
+ x_name_with_from = f'{x_name}_from'
+ x_name_with_to = f'{x_name}_to'
+ elif coded_value == 'duration':
x_name_with_from = 'polity_year_from'
x_name_with_to = 'polity_year_to'
elif coded_value == 'peak_years':
@@ -7801,24 +7876,53 @@ def dynamic_update_view_old(request, object_id, form_class, model_class, x_name,
my_form = form_class(request.POST, instance=my_object)
if my_form.is_valid():
- # print(f"ZARAGOOOOOOOOOOOZA (NEW): {my_form.cleaned_data['expert_reviewed_by_me']}.")
- # my_form.instance.expert_reviewed = my_form.cleaned_data['expert_reviewed_by_me']
-
- new_object = my_form.save()
+ logged_in_user = request.user
+ new_object = my_form.save(commit=False)
+ suggested_experts = my_form.cleaned_data['suggested_expert'] # Adjust the field name
+ #is_reviewed_by_me = my_form.cleaned_data['expert_reviewed_by_me'] # Adjust the field name
+ try:
+ logged_in_expert = Seshat_Expert.objects.get(user=logged_in_user)
+ except:
+ logged_in_expert = None
+
+
+ if suggested_experts:
+ if new_object.private_comment and new_object.private_comment.id != 1:
+ print('##### ID ######', new_object.private_comment.id)
+ father_private_comment = new_object.private_comment
+ else:
+ # create a Prvate Comment to attach parts to it:
+ father_private_comment = SeshatPrivateComment.objects.create(text="")
+ new_object.private_comment = father_private_comment
+ seshat_private_comment_part = SeshatPrivateCommentPart(
+ private_comment_part_text=f"I have coded a new record for the variable '{new_object.name}' on the polity: '{new_object.polity}'. I would appreciate it if you could review it.",
+ private_comment_owner=logged_in_expert,
+ private_comment= father_private_comment
+ )
+
+ print("####################", new_object)
+ print(seshat_private_comment_part)
+ print(father_private_comment)
+ print('-----------------------')
+ seshat_private_comment_part.save()
+ seshat_private_comment_part.private_comment_reader.add(*suggested_experts)
+
+ new_object.expert_reviewed = False
+ new_object.save() # Save the object to persist the association
+
+ action = request.POST.get('action')
+ if action == 'redirect_one':
+ return redirect("polity-detail-main", pk=new_object.polity.id)
+ elif action == 'redirect_two':
+ # if the object has some description already
+ if new_object.comment:
+ return redirect(f"seshatcomment-update", pk=new_object.comment.id)
+ else:
+ return redirect(f"{x_name}-detail", pk=new_object.id)
+ # Replace 'success_url_name' with your success URL
- # Add the current user as a curator if they are an instance of Seshat_Expert
- # logged_in_user = request.user
- # try:
- # seshat_expert_instance = Seshat_Expert.objects.get(user=logged_in_user)
- # except:
- # seshat_expert_instance = None
- # if seshat_expert_instance:
- # print("Alllllllloooooooooooooooo: ", logged_in_user)
- # new_object.curator.add(seshat_expert_instance)
- return redirect("polity-detail-main", pk=my_object.polity.id)
- #return redirect(f"{x_name}-detail", pk=my_object.id)
# Prepare the context for invalid form
context = {
@@ -7831,17 +7935,45 @@ def dynamic_update_view_old(request, object_id, form_class, model_class, x_name,
"my_exp": my_exp,
#'expert_reviewed_by_me': my_form['expert_reviewed_by_me'],
}
- if coded_value in ['preceding_entity']:
+
+ if coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall']:
+ context.update({
+ 'extra_var': my_form[x_name_with_from],
+ 'extra_var2': my_form[x_name_with_to],
+ })
+ elif coded_value in ['preceding_entity']:
context.update({
'extra_var': my_form['other_polity'],
'extra_var2': my_form['merged_old_data'],
'extra_var3': my_form['relationship_to_preceding_entity'],
})
+ elif coded_value in ['widespread_religion']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ })
+ elif coded_value in ['power_transition']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ 'extra_var4': my_form[x_name_4],
+ 'extra_var5': my_form[x_name_5],
+ 'extra_var6': my_form[x_name_6],
+ 'extra_var7': my_form[x_name_7],
+ 'extra_var8': my_form[x_name_8],
+ 'extra_var9': my_form[x_name_9],
+ 'extra_var10': my_form[x_name_10],
+ 'extra_var11': my_form[x_name_11],
+ 'extra_var12': my_form[x_name_12],
+ 'extra_var13': my_form[x_name_13],
+ 'extra_var14': my_form[x_name_14],
+ })
elif coded_value in ['suprapolity_relations']:
context.update({
'extra_var': my_form['supra_polity_relations'],
'extra_var2': my_form['other_polity'],
-
})
elif coded_value in ['duration', 'peak_years', 'scale_of_supracultural_interaction']:
context.update({
@@ -7871,12 +8003,42 @@ def dynamic_update_view_old(request, object_id, form_class, model_class, x_name,
#'expert_reviewed_by_me': my_form['expert_reviewed_by_me']
}
- if coded_value in ['preceding_entity']:
+
+ if coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall']:
+ context.update({
+ 'extra_var': my_form[x_name_with_from],
+ 'extra_var2': my_form[x_name_with_to],
+ })
+ elif coded_value in ['preceding_entity']:
context.update({
'extra_var': my_form['other_polity'],
'extra_var2': my_form['merged_old_data'],
'extra_var3': my_form['relationship_to_preceding_entity'],
})
+ elif coded_value in ['widespread_religion']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ })
+ elif coded_value in ['power_transition']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ 'extra_var4': my_form[x_name_4],
+ 'extra_var5': my_form[x_name_5],
+ 'extra_var6': my_form[x_name_6],
+ 'extra_var7': my_form[x_name_7],
+ 'extra_var8': my_form[x_name_8],
+ 'extra_var9': my_form[x_name_9],
+ 'extra_var10': my_form[x_name_10],
+ 'extra_var11': my_form[x_name_11],
+ 'extra_var12': my_form[x_name_12],
+ 'extra_var13': my_form[x_name_13],
+ 'extra_var14': my_form[x_name_14],
+
+ })
elif coded_value in ['suprapolity_relations']:
context.update({
'extra_var': my_form['supra_polity_relations'],
@@ -7907,7 +8069,14 @@ def dynamic_update_view(request, object_id, form_class, model_class, x_name, cod
# Retrieve the object based on the object_id
my_object = model_class.objects.get(id=object_id)
- if coded_value == 'duration':
+ if coded_value == "power_transition":
+ x_name_1, x_name_2, x_name_3, x_name_4, x_name_5, x_name_6, x_name_7, x_name_8, x_name_9, x_name_10, x_name_11, x_name_12, x_name_13, x_name_14 = 'name', 'predecessor', 'successor', 'contested', 'overturn', 'predecessor_assassination', 'intra_elite', 'military_revolt', 'popular_uprising', 'separatist_rebellion', 'external_invasion', 'external_interference', 'drb_reviewed', 'description'
+ elif coded_value == "widespread_religion":
+ x_name_1, x_name_2, x_name_3 = "order", "widespread_religion", "degree_of_prevalence"
+ elif coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall' ]:
+ x_name_with_from = f'{x_name}_from'
+ x_name_with_to = f'{x_name}_to'
+ elif coded_value == 'duration':
x_name_with_from = 'polity_year_from'
x_name_with_to = 'polity_year_to'
elif coded_value == 'peak_years':
@@ -7926,7 +8095,52 @@ def dynamic_update_view(request, object_id, form_class, model_class, x_name, cod
#print(f"ZARAGOOOOOOOOOOOZA (NEW): {my_form.cleaned_data['expert_reviewed_by_me']}.")
#my_form.instance.expert_reviewed = my_form.cleaned_data['expert_reviewed_by_me']
- new_object = my_form.save()
+ logged_in_user = request.user
+ new_object = my_form.save(commit=False)
+ suggested_experts = my_form.cleaned_data['suggested_expert'] # Adjust the field name
+ #is_reviewed_by_me = my_form.cleaned_data['expert_reviewed_by_me'] # Adjust the field name
+ try:
+ logged_in_expert = Seshat_Expert.objects.get(user=logged_in_user)
+ except:
+ logged_in_expert = None
+
+
+ if suggested_experts:
+ if new_object.private_comment and new_object.private_comment.id != 1:
+ print('##### ID ######', new_object.private_comment.id)
+ father_private_comment = new_object.private_comment
+ else:
+ # create a Prvate Comment to attach parts to it:
+ father_private_comment = SeshatPrivateComment.objects.create(text="")
+ new_object.private_comment = father_private_comment
+ seshat_private_comment_part = SeshatPrivateCommentPart(
+ private_comment_part_text=f"I have coded a new record for the variable '{new_object.name}' on the polity: '{new_object.polity}'. I would appreciate it if you could review it.",
+ private_comment_owner=logged_in_expert,
+ private_comment= father_private_comment
+ )
+
+ print("####################", new_object)
+ print(seshat_private_comment_part)
+ print(father_private_comment)
+
+ seshat_private_comment_part.save()
+
+ seshat_private_comment_part.private_comment_reader.add(*suggested_experts)
+
+ new_object.expert_reviewed = False
+ new_object.save() # Save the object to persist the association
+
+
+ action = request.POST.get('action')
+ if action == 'redirect_one':
+ return redirect("polity-detail-main", pk=new_object.polity.id)
+ elif action == 'redirect_two':
+ # if the object has some description already
+ if new_object.comment:
+ return redirect(f"seshatcomment-update", pk=new_object.comment.id)
+ else:
+ return redirect(f"{x_name}-detail", pk=new_object.id)
+ # Replace 'success_url_name' with your success URL
# Add the current user as a curator if they are an instance of Seshat_Expert
@@ -7939,7 +8153,7 @@ def dynamic_update_view(request, object_id, form_class, model_class, x_name, cod
# if seshat_expert_instance:
# print("Alllllllloooooooooooooooo: ", logged_in_user)
# new_object.curator.add(seshat_expert_instance)
- return redirect(f"{x_name}-detail", pk=my_object.id)
+ #return redirect(f"{x_name}-detail", pk=my_object.id)
# Prepare the context for invalid form
context = {
@@ -7953,12 +8167,41 @@ def dynamic_update_view(request, object_id, form_class, model_class, x_name, cod
#'expert_reviewed_by_me': my_form['expert_reviewed_by_me']
}
- if coded_value in ['preceding_entity']:
+
+ if coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall']:
+ context.update({
+ 'extra_var': my_form[x_name_with_from],
+ 'extra_var2': my_form[x_name_with_to],
+ })
+ elif coded_value in ['preceding_entity']:
context.update({
'extra_var': my_form['other_polity'],
'extra_var2': my_form['merged_old_data'],
'extra_var3': my_form['relationship_to_preceding_entity'],
})
+ elif coded_value in ['widespread_religion']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ })
+ elif coded_value in ['power_transition']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ 'extra_var4': my_form[x_name_4],
+ 'extra_var5': my_form[x_name_5],
+ 'extra_var6': my_form[x_name_6],
+ 'extra_var7': my_form[x_name_7],
+ 'extra_var8': my_form[x_name_8],
+ 'extra_var9': my_form[x_name_9],
+ 'extra_var10': my_form[x_name_10],
+ 'extra_var11': my_form[x_name_11],
+ 'extra_var12': my_form[x_name_12],
+ 'extra_var13': my_form[x_name_13],
+ 'extra_var14': my_form[x_name_14],
+ })
elif coded_value in ['suprapolity_relations']:
context.update({
'extra_var': my_form['supra_polity_relations'],
@@ -7993,12 +8236,42 @@ def dynamic_update_view(request, object_id, form_class, model_class, x_name, cod
#'expert_reviewed_by_me': my_form['expert_reviewed_by_me']
}
- if coded_value in ['preceding_entity']:
+
+ if coded_value in ['polity_population', 'polity_territory', 'population_of_the_largest_settlement', "administrative_level", "settlement_hierarchy", "religious_level", "military_level", "largest_communication_distance", "fastest_individual_communication", 'long_wall']:
+ context.update({
+ 'extra_var': my_form[x_name_with_from],
+ 'extra_var2': my_form[x_name_with_to],
+ })
+ elif coded_value in ['preceding_entity']:
context.update({
'extra_var': my_form['other_polity'],
'extra_var2': my_form['merged_old_data'],
'extra_var3': my_form['relationship_to_preceding_entity'],
})
+ elif coded_value in ['widespread_religion']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ })
+ elif coded_value in ['power_transition']:
+ context.update({
+ 'extra_var': my_form[x_name_1],
+ 'extra_var2': my_form[x_name_2],
+ 'extra_var3': my_form[x_name_3],
+ 'extra_var4': my_form[x_name_4],
+ 'extra_var5': my_form[x_name_5],
+ 'extra_var6': my_form[x_name_6],
+ 'extra_var7': my_form[x_name_7],
+ 'extra_var8': my_form[x_name_8],
+ 'extra_var9': my_form[x_name_9],
+ 'extra_var10': my_form[x_name_10],
+ 'extra_var11': my_form[x_name_11],
+ 'extra_var12': my_form[x_name_12],
+ 'extra_var13': my_form[x_name_13],
+ 'extra_var14': my_form[x_name_14],
+
+ })
elif coded_value in ['suprapolity_relations']:
context.update({
'extra_var': my_form['supra_polity_relations'],
@@ -8023,6 +8296,70 @@ def dynamic_update_view(request, object_id, form_class, model_class, x_name, cod
return render(request, 'core/generic_templates/generic_update.html', context)
+def generic_list_view(request, model_class, var_name, var_name_display, var_section, var_subsection, var_main_desc):
+ if var_name in ["widespread_religion",]:
+ object_list = model_class.objects.all().order_by('polity_id', 'order')
+ else:
+ object_list = model_class.objects.all()
+ #extra_var_dict = {obj.id: obj.__dict__.get(var_name) for obj in object_list}
+ extra_var_dict = {obj.id: obj.show_value() for obj in object_list}
+
+ orderby = request.GET.get('orderby', None)
+
+ # Apply sorting if orderby is provided and is a valid field name
+ if orderby and hasattr(model_class, orderby):
+ object_list = object_list.order_by(orderby)
+
+ var_name_with_from = var_name
+ var_exp_new = f'The absence or presence of "{var_name_display}" for a polity.'
+
+ # if var_name in ["official_religion", "elites_religion",]:
+ # ordering_tag_value = "coded_value_id"
+ # # # ?orderby=formal_legal_code&orderby2=tag
+ # elif var_name in ["widespread_religion",]:
+ # ordering_tag_value = "order"
+ # else:
+ # ordering_tag_value = "coded_value"
+
+ # Define any additional context variables you want to pass to the template
+ context = {
+ 'object_list': object_list,
+ 'var_name': var_name,
+ 'create_url': f'{var_name}-create',
+ 'update_url': f'{var_name}-update',
+ 'update_url_new': f'{var_name}-updatenew',
+ 'download_url': f'{var_name}-download',
+ 'pagination_url': f'{var_name}s',
+ 'metadownload_url': f'{var_name}-metadownload',
+ 'list_all_url': f'{var_name}s_all',
+ 'var_name_display': var_name_display,
+ 'ordering_tag': f"?orderby={var_name}",
+ 'var_section': var_section,
+ 'var_subsection': var_subsection,
+ 'var_main_desc': var_main_desc,
+ 'myvar': var_name_display,
+ 'extra_var_dict': extra_var_dict, # Add the dictionary to the context
+ #'extra_var': obj[var_name],
+
+ #'obj_var': my_form[x_name],
+ #"myvar": myvar,
+ #"my_exp": my_exp,
+ }
+
+
+ context["inner_vars"] = {
+ var_name_display: {
+ 'min': None,
+ 'max': None,
+ 'scale': None,
+ 'var_exp_source': None,
+ 'var_exp': var_exp_new,
+ 'units': None,
+ 'choices': 'ABSENT_PRESENT_CHOICES',
+ 'null_meaning': None}}
+
+ return render(request, 'core/generic_templates/generic_list_all.html', context)
+
def generic_list_view(request, model_class, var_name, coded_value, var_name_display, var_section, var_subsection, var_main_desc):
diff --git a/seshat/apps/rt/forms.py b/seshat/apps/rt/forms.py
index a45f77741..44cf9d0f1 100644
--- a/seshat/apps/rt/forms.py
+++ b/seshat/apps/rt/forms.py
@@ -9,38 +9,42 @@
from django.utils.translation import gettext_lazy as _
from django.contrib.admin.widgets import FilteredSelectMultiple
+from seshat.apps.general.forms import commonlabels, commonfields, commonwidgets, ExpertReviewedForm
+from seshat.apps.accounts.models import Seshat_Expert
+
+
from django.template.defaulttags import register
-commonlabels = {
- 'polity': ' Polity:',
- 'year_from': ' Start Year:',
- 'year_to': ' End Year:',
- 'tag': 'Confidence Level',
- 'description': " Description: ",
- "is_disputed" : " Dispute? ",
- "is_uncertain" : " Uncertainty? ",
- "expert_reviewed" : " Expert Checked? ",
- "drb_reviewed" : " Data Review Board Reviewed?",
- 'citations': 'Add one or more Citations',
- 'finalized': 'This piece of data is verified.',
-}
+# commonlabels = {
+# 'polity': ' Polity:',
+# 'year_from': ' Start Year:',
+# 'year_to': ' End Year:',
+# 'tag': 'Confidence Level',
+# 'description': " Description: ",
+# "is_disputed" : " Dispute? ",
+# "is_uncertain" : " Uncertainty? ",
+# "expert_reviewed" : " Expert Checked? ",
+# "drb_reviewed" : " Data Review Board Reviewed?",
+# 'citations': 'Add one or more Citations',
+# 'finalized': 'This piece of data is verified.',
+# }
-commonfields = ['polity', 'year_from', 'year_to',
- 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
+# commonfields = ['polity', 'year_from', 'year_to',
+# 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
-commonwidgets = {
- 'polity': forms.Select(attrs={'class': 'form-control mb-3 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}),
- 'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
- 'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
- 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 340px; line-height: 1.2;', 'placeholder':'Add a meaningful description (optional)\nNote: USe §REF§ opening and closing tags to include citations to the description.\nExample: §REF§Chadwick, J. 1976. The Mycenaean World, Cambridge, p.78.§REF§.'}),
- 'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
- 'tag': forms.RadioSelect(),
- "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- 'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
-}
+# commonwidgets = {
+# 'polity': forms.Select(attrs={'class': 'form-control mb-3 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}),
+# 'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
+# 'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
+# 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 340px; line-height: 1.2;', 'placeholder':'Add a meaningful description (optional)\nNote: USe §REF§ opening and closing tags to include citations to the description.\nExample: §REF§Chadwick, J. 1976. The Mycenaean World, Cambridge, p.78.§REF§.'}),
+# 'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
+# 'tag': forms.RadioSelect(),
+# "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# 'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
+# }
# class RaForm(forms.ModelForm):
# class Meta:
@@ -52,7 +56,7 @@
# widgets = dict(commonwidgets)
# widgets['sc_ra'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Widespread_religionForm(forms.ModelForm):
+class Widespread_religionForm(ExpertReviewedForm):
"""
Form for creating and updating the Widespread_religion model.
"""
@@ -76,7 +80,7 @@ class Meta:
widgets['order'] = forms.Select(attrs={'class': 'form-control mb-3', })
widgets['degree_of_prevalence'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Official_religionForm(forms.ModelForm):
+class Official_religionForm(ExpertReviewedForm):
"""
Form for creating and updating creating and updating the Official_religion model.
"""
@@ -93,7 +97,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3 js-example-basic-single', 'id': 'id_official_religion', 'name': 'official_religion' })
-class Elites_religionForm(forms.ModelForm):
+class Elites_religionForm(ExpertReviewedForm):
"""
Form for creating and updating the Elites_religion model.
"""
@@ -110,7 +114,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3 js-example-basic-single', 'id': 'id_elites_religion', 'name': 'elites_religion' })
##########################################
-class Theo_sync_dif_relForm(forms.ModelForm):
+class Theo_sync_dif_relForm(ExpertReviewedForm):
"""
Form for creating and updating the Theo_sync_dif_rel model.
"""
@@ -127,7 +131,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Sync_rel_pra_ind_beliForm(forms.ModelForm):
+class Sync_rel_pra_ind_beliForm(ExpertReviewedForm):
"""
Form for creating and updating the Sync_rel_pra_ind_beli model.
"""
@@ -144,7 +148,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Religious_fragmentationForm(forms.ModelForm):
+class Religious_fragmentationForm(ExpertReviewedForm):
"""
Form for creating and updating the Religious_fragmentation model.
"""
@@ -161,7 +165,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_vio_freq_rel_grpForm(forms.ModelForm):
+class Gov_vio_freq_rel_grpForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_vio_freq_rel_grp model.
"""
@@ -178,7 +182,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_pub_worForm(forms.ModelForm):
+class Gov_res_pub_worForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_pub_wor model.
"""
@@ -195,7 +199,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_pub_prosForm(forms.ModelForm):
+class Gov_res_pub_prosForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_pub_pros model.
"""
@@ -212,7 +216,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_convForm(forms.ModelForm):
+class Gov_res_convForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_conv model.
"""
@@ -229,7 +233,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_press_convForm(forms.ModelForm):
+class Gov_press_convForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_press_conv model.
"""
@@ -246,7 +250,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_prop_own_for_rel_grpForm(forms.ModelForm):
+class Gov_res_prop_own_for_rel_grpForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_prop_own_for_rel_grp model.
"""
@@ -263,7 +267,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Tax_rel_adh_act_insForm(forms.ModelForm):
+class Tax_rel_adh_act_insForm(ExpertReviewedForm):
"""
Form for creating and updating the Tax_rel_adh_act_ins model.
"""
@@ -280,7 +284,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_obl_rel_grp_ofc_recoForm(forms.ModelForm):
+class Gov_obl_rel_grp_ofc_recoForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_obl_rel_grp_ofc_reco model.
"""
@@ -297,7 +301,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_cons_rel_builForm(forms.ModelForm):
+class Gov_res_cons_rel_builForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_cons_rel_buil model.
"""
@@ -314,7 +318,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_rel_eduForm(forms.ModelForm):
+class Gov_res_rel_eduForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_rel_edu model.
"""
@@ -331,7 +335,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_res_cir_rel_litForm(forms.ModelForm):
+class Gov_res_cir_rel_litForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_res_cir_rel_lit model.
"""
@@ -348,7 +352,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_dis_rel_grp_occ_funForm(forms.ModelForm):
+class Gov_dis_rel_grp_occ_funForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_dis_rel_grp_occ_fun model.
"""
@@ -365,7 +369,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Soc_vio_freq_rel_grpForm(forms.ModelForm):
+class Soc_vio_freq_rel_grpForm(ExpertReviewedForm):
"""
Form for creating and updating the Soc_vio_freq_rel_grp model.
"""
@@ -382,7 +386,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Soc_dis_rel_grp_occ_funForm(forms.ModelForm):
+class Soc_dis_rel_grp_occ_funForm(ExpertReviewedForm):
"""
Form for creating and updating the Soc_dis_rel_grp_occ_fun model.
"""
@@ -399,7 +403,7 @@ class Meta:
widgets['coded_value'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gov_press_conv_for_agaForm(forms.ModelForm):
+class Gov_press_conv_for_agaForm(ExpertReviewedForm):
"""
Form for creating and updating the Gov_press_conv_for_aga model.
"""
diff --git a/seshat/apps/rt/migrations/0011_alter_elites_religion_comment_and_more.py b/seshat/apps/rt/migrations/0011_alter_elites_religion_comment_and_more.py
new file mode 100644
index 000000000..3b6e56ffe
--- /dev/null
+++ b/seshat/apps/rt/migrations/0011_alter_elites_religion_comment_and_more.py
@@ -0,0 +1,120 @@
+# Generated by Django 4.0.3 on 2024-12-06 18:51
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('core', '0068_rename_videoshapefile_cliopatria'),
+ ('rt', '0010_alter_gov_dis_rel_grp_occ_fun_coded_value_and_more'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='elites_religion',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_dis_rel_grp_occ_fun',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_obl_rel_grp_ofc_reco',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_press_conv',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_press_conv_for_aga',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_cir_rel_lit',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_cons_rel_buil',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_conv',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_prop_own_for_rel_grp',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_pub_pros',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_pub_wor',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_res_rel_edu',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gov_vio_freq_rel_grp',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='official_religion',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='religious_fragmentation',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='soc_dis_rel_grp_occ_fun',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='soc_vio_freq_rel_grp',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='sync_rel_pra_ind_beli',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='tax_rel_adh_act_ins',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='theo_sync_dif_rel',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='widespread_religion',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ ]
diff --git a/seshat/apps/rt/urls.py b/seshat/apps/rt/urls.py
index ef57db28a..92d82f689 100644
--- a/seshat/apps/rt/urls.py
+++ b/seshat/apps/rt/urls.py
@@ -6,7 +6,7 @@
-from .views import dynamic_create_view, dynamic_update_view, dynamic_update_view_old, generic_list_view, generic_download, generic_metadata_download, dynamic_detail_view, confirm_delete_view, delete_object_view
+from seshat.apps.general.views import dynamic_create_view, dynamic_update_view, dynamic_update_view_old, generic_list_view, generic_download, generic_metadata_download, dynamic_detail_view, confirm_delete_view, delete_object_view, delete_object_view
from .var_defs import rt_var_defs
@@ -14,27 +14,27 @@
from . import views
model_form_pairs = [
- (Widespread_religion, Widespread_religionForm, 'widespread_religion', 'Widespread Religion', "Religious Landscape", None),
- (Official_religion, Official_religionForm, 'official_religion', 'Official Religion', "Religious Landscape", None),
- (Elites_religion, Elites_religionForm, 'elites_religion', 'Elites Religion', "Religious Landscape", None),
- (Theo_sync_dif_rel, Theo_sync_dif_relForm, 'theo_sync_dif_rel', 'Theological Syncretism Of Different Religions', "Religious Landscape", None),
- (Sync_rel_pra_ind_beli, Sync_rel_pra_ind_beliForm, 'sync_rel_pra_ind_beli', 'Syncretism Of Religious Practices At The Level Of Individual Believers', "Religious Landscape", None),
- (Religious_fragmentation, Religious_fragmentationForm, 'religious_fragmentation', 'Religious Fragmentation', "Religious Landscape", None),
- (Gov_vio_freq_rel_grp, Gov_vio_freq_rel_grpForm, 'gov_vio_freq_rel_grp', 'Frequency Of Governmental Violence Against Religious Groups', "Government Restrictions", None),
- (Gov_res_pub_wor, Gov_res_pub_worForm, 'gov_res_pub_wor', 'Government Restrictions On Public Worship', "Government Restrictions", None),
- (Gov_res_pub_pros, Gov_res_pub_prosForm, 'gov_res_pub_pros', 'Government Restrictions On Public Proselytizing', "Government Restrictions", None),
- (Gov_res_conv, Gov_res_convForm, 'gov_res_conv', 'Government Restrictions On Conversion', "Government Restrictions", None),
- (Gov_press_conv, Gov_press_convForm, 'gov_press_conv', 'Government Pressure To Convert', "Government Restrictions", None),
- (Gov_res_prop_own_for_rel_grp, Gov_res_prop_own_for_rel_grpForm, 'gov_res_prop_own_for_rel_grp', 'Government Restrictions On Property Ownership For Adherents Of Any Religious Group', "Government Restrictions", None),
- (Tax_rel_adh_act_ins, Tax_rel_adh_act_insForm, 'tax_rel_adh_act_ins', 'Taxes Based On Religious Adherence Or On Religious Activities And Institutions', "Government Restrictions", None),
- (Gov_obl_rel_grp_ofc_reco, Gov_obl_rel_grp_ofc_recoForm, 'gov_obl_rel_grp_ofc_reco', 'Governmental Obligations For Religious Groups To Apply For Official Recognition', "Government Restrictions", None),
- (Gov_res_cons_rel_buil, Gov_res_cons_rel_builForm, 'gov_res_cons_rel_buil', 'Government Restrictions On Construction Of Religious Buildings', "Government Restrictions", None),
- (Gov_res_rel_edu, Gov_res_rel_eduForm, 'gov_res_rel_edu', 'Government Restrictions On Religious Education', "Government Restrictions", None),
- (Gov_res_cir_rel_lit, Gov_res_cir_rel_litForm, 'gov_res_cir_rel_lit', 'Government Restrictions On Circulation Of Religious Literature', "Government Restrictions", None),
- (Gov_dis_rel_grp_occ_fun, Gov_dis_rel_grp_occ_funForm, 'gov_dis_rel_grp_occ_fun', 'Government Discrimination Against Religious Groups Taking Up Certain Occupations Or Functions', "Government Restrictions", None),
- (Soc_vio_freq_rel_grp, Soc_vio_freq_rel_grpForm, 'soc_vio_freq_rel_grp', 'Frequency Of Societal Violence Against Religious Groups', "Societal Restrictions", None),
- (Soc_dis_rel_grp_occ_fun, Soc_dis_rel_grp_occ_funForm, 'soc_dis_rel_grp_occ_fun', 'Societal Discrimination Against Religious Groups Taking Up Certain Occupations Or Functions', "Societal Restrictions", None),
- (Gov_press_conv_for_aga, Gov_press_conv_for_agaForm, 'gov_press_conv_for_aga', 'Societal Pressure To Convert Or Against Conversion', "Societal Restrictions", None),]
+ (Widespread_religion, Widespread_religionForm,'widespread_religion', 'widespread_religion', 'Widespread Religion', "Religious Landscape", None, 'rt'),
+ (Official_religion, Official_religionForm, 'coded_value', 'official_religion', 'Official Religion', "Religious Landscape", None, 'rt'),
+ (Elites_religion, Elites_religionForm, 'coded_value', 'elites_religion', 'Elites Religion', "Religious Landscape", None, 'rt'),
+ (Theo_sync_dif_rel, Theo_sync_dif_relForm, 'coded_value', 'theo_sync_dif_rel', 'Theological Syncretism Of Different Religions', "Religious Landscape", None, 'rt'),
+ (Sync_rel_pra_ind_beli, Sync_rel_pra_ind_beliForm, 'coded_value', 'sync_rel_pra_ind_beli', 'Syncretism Of Religious Practices At The Level Of Individual Believers', "Religious Landscape", None, 'rt'),
+ (Religious_fragmentation, Religious_fragmentationForm, 'coded_value', 'religious_fragmentation', 'Religious Fragmentation', "Religious Landscape", None, 'rt'),
+ (Gov_vio_freq_rel_grp, Gov_vio_freq_rel_grpForm, 'coded_value', 'gov_vio_freq_rel_grp', 'Frequency Of Governmental Violence Against Religious Groups', "Government Restrictions", None, 'rt'),
+ (Gov_res_pub_wor, Gov_res_pub_worForm, 'coded_value', 'gov_res_pub_wor', 'Government Restrictions On Public Worship', "Government Restrictions", None, 'rt'),
+ (Gov_res_pub_pros, Gov_res_pub_prosForm, 'coded_value', 'gov_res_pub_pros', 'Government Restrictions On Public Proselytizing', "Government Restrictions", None, 'rt'),
+ (Gov_res_conv, Gov_res_convForm, 'coded_value', 'gov_res_conv', 'Government Restrictions On Conversion', "Government Restrictions", None, 'rt'),
+ (Gov_press_conv, Gov_press_convForm, 'coded_value', 'gov_press_conv', 'Government Pressure To Convert', "Government Restrictions", None, 'rt'),
+ (Gov_res_prop_own_for_rel_grp, Gov_res_prop_own_for_rel_grpForm, 'coded_value', 'gov_res_prop_own_for_rel_grp', 'Government Restrictions On Property Ownership For Adherents Of Any Religious Group', "Government Restrictions", None, 'rt'),
+ (Tax_rel_adh_act_ins, Tax_rel_adh_act_insForm, 'coded_value', 'tax_rel_adh_act_ins', 'Taxes Based On Religious Adherence Or On Religious Activities And Institutions', "Government Restrictions", None, 'rt'),
+ (Gov_obl_rel_grp_ofc_reco, Gov_obl_rel_grp_ofc_recoForm, 'coded_value', 'gov_obl_rel_grp_ofc_reco', 'Governmental Obligations For Religious Groups To Apply For Official Recognition', "Government Restrictions", None, 'rt'),
+ (Gov_res_cons_rel_buil, Gov_res_cons_rel_builForm, 'coded_value', 'gov_res_cons_rel_buil', 'Government Restrictions On Construction Of Religious Buildings', "Government Restrictions", None, 'rt'),
+ (Gov_res_rel_edu, Gov_res_rel_eduForm, 'coded_value', 'gov_res_rel_edu', 'Government Restrictions On Religious Education', "Government Restrictions", None, 'rt'),
+ (Gov_res_cir_rel_lit, Gov_res_cir_rel_litForm, 'coded_value', 'gov_res_cir_rel_lit', 'Government Restrictions On Circulation Of Religious Literature', "Government Restrictions", None, 'rt'),
+ (Gov_dis_rel_grp_occ_fun, Gov_dis_rel_grp_occ_funForm, 'coded_value', 'gov_dis_rel_grp_occ_fun', 'Government Discrimination Against Religious Groups Taking Up Certain Occupations Or Functions', "Government Restrictions", None, 'rt'),
+ (Soc_vio_freq_rel_grp, Soc_vio_freq_rel_grpForm, 'coded_value', 'soc_vio_freq_rel_grp', 'Frequency Of Societal Violence Against Religious Groups', "Societal Restrictions", None, 'rt'),
+ (Soc_dis_rel_grp_occ_fun, Soc_dis_rel_grp_occ_funForm, 'coded_value', 'soc_dis_rel_grp_occ_fun', 'Societal Discrimination Against Religious Groups Taking Up Certain Occupations Or Functions', "Societal Restrictions", None, 'rt'),
+ (Gov_press_conv_for_aga, Gov_press_conv_for_agaForm, 'coded_value', 'gov_press_conv_for_aga', 'Societal Pressure To Convert Or Against Conversion', "Societal Restrictions", None, 'rt'),]
urlpatterns = [
@@ -58,13 +58,14 @@
# Create URL patterns dynamically for each model-class pair: UPDATE
-for model_class, form_class, x_name, myvar, sec, subsec in model_form_pairs:
+for model_class, form_class, coded_value, x_name, myvar, sec, subsec, db_section in model_form_pairs:
urlpatterns.append(
path(f'{x_name}/updatenew//', dynamic_update_view, {
'form_class': form_class,
'model_class': model_class,
'x_name': x_name,
'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': rt_var_defs[myvar.lower().capitalize()],
'var_section': sec,
'var_subsection': subsec,
@@ -77,6 +78,7 @@
'model_class': model_class,
'x_name': x_name,
'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': rt_var_defs[myvar.lower().capitalize()],
'var_section': sec,
'var_subsection': subsec,
@@ -88,6 +90,7 @@
'form_class': form_class,
'x_name': x_name,
'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': rt_var_defs[myvar.lower().capitalize()],
'var_section': sec,
'var_subsection': subsec,
@@ -97,6 +100,7 @@
path(f'{x_name}s_all/', generic_list_view, {
'model_class': model_class,
'var_name': x_name,
+ 'coded_value': coded_value,
'var_name_display': myvar,
'var_section': sec,
'var_subsection': subsec,
@@ -104,7 +108,7 @@
}, name=f'{x_name}s_all')
)
urlpatterns.append(
- path(f'{x_name}download/', generic_download, {
+ path(f'{x_name}download/', views.generic_download, {
'model_class': model_class,
'var_name': x_name,
}, name=f'{x_name}-download')
@@ -121,16 +125,20 @@
urlpatterns.append(
path(f'{x_name}//', dynamic_detail_view, {
'model_class': model_class,
- 'myvar': x_name,
+ 'myvar': x_name,
'var_name_display': myvar,
+ 'var_section': sec,
+ 'var_subsection': subsec,
+ 'db_section': db_section,
}, name=f'{x_name}-detail')
)
- #urlpatterns.append(
- # path(f'{x_name}//delete/', generic_delete_view, {
- # 'model_class': model_class,
- # 'var_name': x_name,
- # }, name=f'{x_name}-delete')
- # )
+
+ urlpatterns.append(
+ path(f'{x_name}//delete/', delete_object_view, {
+ 'model_class': model_class,
+ 'var_name': x_name,
+ }, name=f'{x_name}-delete')
+ )
urlpatterns.append(
path(f'{x_name}//confirm-delete/', confirm_delete_view, {
'model_class': model_class,
diff --git a/seshat/apps/sc/forms.py b/seshat/apps/sc/forms.py
index 9bef4c26b..1b46dd858 100644
--- a/seshat/apps/sc/forms.py
+++ b/seshat/apps/sc/forms.py
@@ -6,6 +6,9 @@
from django.forms import ModelForm
from django.forms.widgets import Textarea
+from seshat.apps.general.forms import commonlabels, commonfields, commonwidgets, ExpertReviewedForm
+from seshat.apps.accounts.models import Seshat_Expert
+
from django.utils.safestring import mark_safe
from django.core.exceptions import ValidationError
@@ -14,38 +17,39 @@
from django.template.defaulttags import register
-commonlabels = {
- 'polity': ' Polity:',
- 'year_from': ' Start Year:',
- 'year_to': ' End Year:',
- 'tag': 'Confidence Level',
- 'description': " Description: ",
- "is_disputed" : "Dispute?",
- "is_uncertain" : "Uncertainty?",
- "expert_reviewed" : "Expert Checked?",
- "drb_reviewed" : " Data Review Board Reviewed?",
- 'citations': 'Add one or more Citations',
- 'finalized': 'This piece of data is verified.',
-}
-commonfields = ['polity', 'year_from', 'year_to',
- 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
+# commonlabels = {
+# 'polity': ' Polity:',
+# 'year_from': ' Start Year:',
+# 'year_to': ' End Year:',
+# 'tag': 'Confidence Level',
+# 'description': " Description: ",
+# "is_disputed" : "Dispute?",
+# "is_uncertain" : "Uncertainty?",
+# "expert_reviewed" : "Expert Checked?",
+# "drb_reviewed" : " Data Review Board Reviewed?",
+# 'citations': 'Add one or more Citations',
+# 'finalized': 'This piece of data is verified.',
+# }
+
+# commonfields = ['polity', 'year_from', 'year_to',
+# 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
-commonwidgets = {
- 'polity': forms.Select(attrs={'class': 'form-control mb-3 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}),
- 'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
- 'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
- 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 240px; line-height: 1.2;', 'placeholder':'Add a meaningful description (optional)\nNote: USe §REF§ opening and closing tags to include citations to the description.\nExample: §REF§Chadwick, J. 1976. The Mycenaean World, Cambridge, p.78.§REF§.'}),
- 'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
- 'tag': forms.RadioSelect(),
- "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- 'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
-}
+# commonwidgets = {
+# 'polity': forms.Select(attrs={'class': 'form-control mb-3 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}),
+# 'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
+# 'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
+# 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 240px; line-height: 1.2;', 'placeholder':'Add a meaningful description (optional)\nNote: USe §REF§ opening and closing tags to include citations to the description.\nExample: §REF§Chadwick, J. 1976. The Mycenaean World, Cambridge, p.78.§REF§.'}),
+# 'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
+# 'tag': forms.RadioSelect(),
+# "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# 'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
+# }
-class RaForm(forms.ModelForm):
+class RaForm(ExpertReviewedForm):
"""
"""
@@ -62,7 +66,7 @@ class Meta:
widgets['sc_ra'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Polity_territoryForm(forms.ModelForm):
+class Polity_territoryForm(ExpertReviewedForm):
"""
"""
@@ -81,7 +85,7 @@ class Meta:
widgets['polity_territory_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Polity_populationForm(forms.ModelForm):
+class Polity_populationForm(ExpertReviewedForm):
"""
"""
@@ -100,7 +104,7 @@ class Meta:
widgets['polity_population_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Population_of_the_largest_settlementForm(forms.ModelForm):
+class Population_of_the_largest_settlementForm(ExpertReviewedForm):
"""
"""
@@ -119,7 +123,7 @@ class Meta:
widgets['population_of_the_largest_settlement_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Settlement_hierarchyForm(forms.ModelForm):
+class Settlement_hierarchyForm(ExpertReviewedForm):
"""
"""
@@ -138,7 +142,7 @@ class Meta:
widgets['settlement_hierarchy_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Administrative_levelForm(forms.ModelForm):
+class Administrative_levelForm(ExpertReviewedForm):
"""
"""
@@ -157,7 +161,7 @@ class Meta:
widgets['administrative_level_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Religious_levelForm(forms.ModelForm):
+class Religious_levelForm(ExpertReviewedForm):
"""
"""
@@ -176,7 +180,7 @@ class Meta:
widgets['religious_level_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Military_levelForm(forms.ModelForm):
+class Military_levelForm(ExpertReviewedForm):
"""
"""
@@ -195,7 +199,7 @@ class Meta:
widgets['military_level_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Professional_military_officerForm(forms.ModelForm):
+class Professional_military_officerForm(ExpertReviewedForm):
"""
"""
@@ -212,7 +216,7 @@ class Meta:
widgets['professional_military_officer'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Professional_soldierForm(forms.ModelForm):
+class Professional_soldierForm(ExpertReviewedForm):
"""
"""
@@ -229,7 +233,7 @@ class Meta:
widgets['professional_soldier'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Professional_priesthoodForm(forms.ModelForm):
+class Professional_priesthoodForm(ExpertReviewedForm):
"""
"""
@@ -246,7 +250,7 @@ class Meta:
widgets['professional_priesthood'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Full_time_bureaucratForm(forms.ModelForm):
+class Full_time_bureaucratForm(ExpertReviewedForm):
"""
"""
@@ -263,7 +267,7 @@ class Meta:
widgets['full_time_bureaucrat'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Examination_systemForm(forms.ModelForm):
+class Examination_systemForm(ExpertReviewedForm):
"""
"""
@@ -280,7 +284,7 @@ class Meta:
widgets['examination_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Merit_promotionForm(forms.ModelForm):
+class Merit_promotionForm(ExpertReviewedForm):
"""
"""
@@ -297,7 +301,7 @@ class Meta:
widgets['merit_promotion'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Specialized_government_buildingForm(forms.ModelForm):
+class Specialized_government_buildingForm(ExpertReviewedForm):
"""
"""
@@ -314,7 +318,7 @@ class Meta:
widgets['specialized_government_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Formal_legal_codeForm(forms.ModelForm):
+class Formal_legal_codeForm(ExpertReviewedForm):
"""
"""
@@ -331,7 +335,7 @@ class Meta:
widgets['formal_legal_code'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class JudgeForm(forms.ModelForm):
+class JudgeForm(ExpertReviewedForm):
"""
"""
@@ -348,7 +352,7 @@ class Meta:
widgets['judge'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class CourtForm(forms.ModelForm):
+class CourtForm(ExpertReviewedForm):
"""
"""
@@ -365,7 +369,7 @@ class Meta:
widgets['court'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Professional_lawyerForm(forms.ModelForm):
+class Professional_lawyerForm(ExpertReviewedForm):
"""
"""
@@ -382,7 +386,7 @@ class Meta:
widgets['professional_lawyer'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Irrigation_systemForm(forms.ModelForm):
+class Irrigation_systemForm(ExpertReviewedForm):
"""
"""
@@ -399,7 +403,7 @@ class Meta:
widgets['irrigation_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Drinking_water_supply_systemForm(forms.ModelForm):
+class Drinking_water_supply_systemForm(ExpertReviewedForm):
"""
"""
@@ -416,7 +420,7 @@ class Meta:
widgets['drinking_water_supply_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class MarketForm(forms.ModelForm):
+class MarketForm(ExpertReviewedForm):
"""
"""
@@ -433,7 +437,7 @@ class Meta:
widgets['market'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Food_storage_siteForm(forms.ModelForm):
+class Food_storage_siteForm(ExpertReviewedForm):
"""
"""
@@ -450,7 +454,7 @@ class Meta:
widgets['food_storage_site'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class RoadForm(forms.ModelForm):
+class RoadForm(ExpertReviewedForm):
"""
"""
@@ -467,7 +471,7 @@ class Meta:
widgets['road'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class BridgeForm(forms.ModelForm):
+class BridgeForm(ExpertReviewedForm):
"""
"""
@@ -484,7 +488,7 @@ class Meta:
widgets['bridge'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class CanalForm(forms.ModelForm):
+class CanalForm(ExpertReviewedForm):
"""
"""
@@ -501,7 +505,7 @@ class Meta:
widgets['canal'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class PortForm(forms.ModelForm):
+class PortForm(ExpertReviewedForm):
"""
"""
@@ -518,7 +522,7 @@ class Meta:
widgets['port'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Mines_or_quarryForm(forms.ModelForm):
+class Mines_or_quarryForm(ExpertReviewedForm):
"""
"""
@@ -535,7 +539,7 @@ class Meta:
widgets['mines_or_quarry'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Mnemonic_deviceForm(forms.ModelForm):
+class Mnemonic_deviceForm(ExpertReviewedForm):
"""
"""
@@ -552,7 +556,7 @@ class Meta:
widgets['mnemonic_device'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Nonwritten_recordForm(forms.ModelForm):
+class Nonwritten_recordForm(ExpertReviewedForm):
"""
"""
@@ -569,7 +573,7 @@ class Meta:
widgets['nonwritten_record'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Written_recordForm(forms.ModelForm):
+class Written_recordForm(ExpertReviewedForm):
"""
"""
@@ -586,7 +590,7 @@ class Meta:
widgets['written_record'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class ScriptForm(forms.ModelForm):
+class ScriptForm(ExpertReviewedForm):
"""
"""
@@ -603,7 +607,7 @@ class Meta:
widgets['script'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Non_phonetic_writingForm(forms.ModelForm):
+class Non_phonetic_writingForm(ExpertReviewedForm):
"""
"""
@@ -620,7 +624,7 @@ class Meta:
widgets['non_phonetic_writing'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Phonetic_alphabetic_writingForm(forms.ModelForm):
+class Phonetic_alphabetic_writingForm(ExpertReviewedForm):
"""
"""
@@ -637,7 +641,7 @@ class Meta:
widgets['phonetic_alphabetic_writing'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Lists_tables_and_classificationForm(forms.ModelForm):
+class Lists_tables_and_classificationForm(ExpertReviewedForm):
"""
"""
@@ -654,7 +658,7 @@ class Meta:
widgets['lists_tables_and_classification'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class CalendarForm(forms.ModelForm):
+class CalendarForm(ExpertReviewedForm):
"""
"""
@@ -671,7 +675,7 @@ class Meta:
widgets['calendar'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Sacred_textForm(forms.ModelForm):
+class Sacred_textForm(ExpertReviewedForm):
"""
"""
@@ -688,7 +692,7 @@ class Meta:
widgets['sacred_text'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Religious_literatureForm(forms.ModelForm):
+class Religious_literatureForm(ExpertReviewedForm):
"""
"""
@@ -705,7 +709,7 @@ class Meta:
widgets['religious_literature'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Practical_literatureForm(forms.ModelForm):
+class Practical_literatureForm(ExpertReviewedForm):
"""
"""
@@ -722,7 +726,7 @@ class Meta:
widgets['practical_literature'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class HistoryForm(forms.ModelForm):
+class HistoryForm(ExpertReviewedForm):
"""
"""
@@ -739,7 +743,7 @@ class Meta:
widgets['history'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class PhilosophyForm(forms.ModelForm):
+class PhilosophyForm(ExpertReviewedForm):
"""
"""
@@ -756,7 +760,7 @@ class Meta:
widgets['philosophy'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Scientific_literatureForm(forms.ModelForm):
+class Scientific_literatureForm(ExpertReviewedForm):
"""
"""
@@ -773,7 +777,7 @@ class Meta:
widgets['scientific_literature'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class FictionForm(forms.ModelForm):
+class FictionForm(ExpertReviewedForm):
"""
"""
@@ -790,7 +794,7 @@ class Meta:
widgets['fiction'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class ArticleForm(forms.ModelForm):
+class ArticleForm(ExpertReviewedForm):
"""
"""
@@ -807,7 +811,7 @@ class Meta:
widgets['article'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class TokenForm(forms.ModelForm):
+class TokenForm(ExpertReviewedForm):
"""
"""
@@ -824,7 +828,7 @@ class Meta:
widgets['token'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Precious_metalForm(forms.ModelForm):
+class Precious_metalForm(ExpertReviewedForm):
"""
"""
@@ -841,7 +845,7 @@ class Meta:
widgets['precious_metal'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Foreign_coinForm(forms.ModelForm):
+class Foreign_coinForm(ExpertReviewedForm):
"""
"""
@@ -858,7 +862,7 @@ class Meta:
widgets['foreign_coin'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Indigenous_coinForm(forms.ModelForm):
+class Indigenous_coinForm(ExpertReviewedForm):
"""
"""
@@ -875,7 +879,7 @@ class Meta:
widgets['indigenous_coin'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Paper_currencyForm(forms.ModelForm):
+class Paper_currencyForm(ExpertReviewedForm):
"""
"""
@@ -892,7 +896,7 @@ class Meta:
widgets['paper_currency'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class CourierForm(forms.ModelForm):
+class CourierForm(ExpertReviewedForm):
"""
"""
@@ -909,7 +913,7 @@ class Meta:
widgets['courier'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Postal_stationForm(forms.ModelForm):
+class Postal_stationForm(ExpertReviewedForm):
"""
"""
@@ -926,7 +930,7 @@ class Meta:
widgets['postal_station'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class General_postal_serviceForm(forms.ModelForm):
+class General_postal_serviceForm(ExpertReviewedForm):
"""
"""
@@ -944,7 +948,7 @@ class Meta:
# NEW SC vars
-class Communal_buildingForm(forms.ModelForm):
+class Communal_buildingForm(ExpertReviewedForm):
"""
"""
@@ -962,7 +966,7 @@ class Meta:
widgets = dict(commonwidgets)
widgets['communal_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Utilitarian_public_buildingForm(forms.ModelForm):
+class Utilitarian_public_buildingForm(ExpertReviewedForm):
"""
"""
@@ -980,7 +984,7 @@ class Meta:
widgets = dict(commonwidgets)
widgets['utilitarian_public_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Other_utilitarian_public_buildingForm(forms.ModelForm):
+class Other_utilitarian_public_buildingForm(ExpertReviewedForm):
"""
"""
@@ -999,7 +1003,7 @@ class Meta:
widgets['other_utilitarian_public_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Symbolic_buildingForm(forms.ModelForm):
+class Symbolic_buildingForm(ExpertReviewedForm):
"""
"""
@@ -1018,7 +1022,7 @@ class Meta:
widgets['symbolic_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Entertainment_buildingForm(forms.ModelForm):
+class Entertainment_buildingForm(ExpertReviewedForm):
"""
"""
@@ -1037,7 +1041,7 @@ class Meta:
widgets['entertainment_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Knowledge_or_information_buildingForm(forms.ModelForm):
+class Knowledge_or_information_buildingForm(ExpertReviewedForm):
"""
"""
@@ -1056,7 +1060,7 @@ class Meta:
widgets['knowledge_or_information_building'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Special_purpose_siteForm(forms.ModelForm):
+class Special_purpose_siteForm(ExpertReviewedForm):
"""
"""
@@ -1075,7 +1079,7 @@ class Meta:
widgets['special_purpose_site'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Ceremonial_siteForm(forms.ModelForm):
+class Ceremonial_siteForm(ExpertReviewedForm):
"""
"""
@@ -1094,7 +1098,7 @@ class Meta:
widgets['ceremonial_site'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Burial_siteForm(forms.ModelForm):
+class Burial_siteForm(ExpertReviewedForm):
"""
"""
@@ -1113,7 +1117,7 @@ class Meta:
widgets['burial_site'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Trading_emporiaForm(forms.ModelForm):
+class Trading_emporiaForm(ExpertReviewedForm):
"""
"""
@@ -1132,7 +1136,7 @@ class Meta:
widgets['trading_emporia'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class EnclosureForm(forms.ModelForm):
+class EnclosureForm(ExpertReviewedForm):
"""
"""
@@ -1151,7 +1155,7 @@ class Meta:
widgets['enclosure'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Length_measurement_systemForm(forms.ModelForm):
+class Length_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1170,7 +1174,7 @@ class Meta:
widgets['length_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Area_measurement_systemForm(forms.ModelForm):
+class Area_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1189,7 +1193,7 @@ class Meta:
widgets['area_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Volume_measurement_systemForm(forms.ModelForm):
+class Volume_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1208,7 +1212,7 @@ class Meta:
widgets['volume_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Weight_measurement_systemForm(forms.ModelForm):
+class Weight_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1227,7 +1231,7 @@ class Meta:
widgets['weight_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Time_measurement_systemForm(forms.ModelForm):
+class Time_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1246,7 +1250,7 @@ class Meta:
widgets['time_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Geometrical_measurement_systemForm(forms.ModelForm):
+class Geometrical_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1265,7 +1269,7 @@ class Meta:
widgets['geometrical_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Other_measurement_systemForm(forms.ModelForm):
+class Other_measurement_systemForm(ExpertReviewedForm):
"""
"""
@@ -1284,7 +1288,7 @@ class Meta:
widgets['other_measurement_system'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Debt_and_credit_structureForm(forms.ModelForm):
+class Debt_and_credit_structureForm(ExpertReviewedForm):
"""
"""
@@ -1303,7 +1307,7 @@ class Meta:
widgets['debt_and_credit_structure'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Store_of_wealthForm(forms.ModelForm):
+class Store_of_wealthForm(ExpertReviewedForm):
"""
"""
@@ -1321,7 +1325,7 @@ class Meta:
widgets = dict(commonwidgets)
widgets['store_of_wealth'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Source_of_supportForm(forms.ModelForm):
+class Source_of_supportForm(ExpertReviewedForm):
"""
"""
@@ -1341,7 +1345,7 @@ class Meta:
-class Occupational_complexityForm(forms.ModelForm):
+class Occupational_complexityForm(ExpertReviewedForm):
"""
"""
@@ -1358,7 +1362,7 @@ class Meta:
widgets['occupational_complexity'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Special_purpose_houseForm(forms.ModelForm):
+class Special_purpose_houseForm(ExpertReviewedForm):
"""
"""
@@ -1375,7 +1379,7 @@ class Meta:
widgets['special_purpose_house'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Other_special_purpose_siteForm(forms.ModelForm):
+class Other_special_purpose_siteForm(ExpertReviewedForm):
"""
"""
@@ -1393,7 +1397,7 @@ class Meta:
-class Largest_communication_distanceForm(forms.ModelForm):
+class Largest_communication_distanceForm(ExpertReviewedForm):
"""
"""
@@ -1413,7 +1417,7 @@ class Meta:
widgets['largest_communication_distance_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class Fastest_individual_communicationForm(forms.ModelForm):
+class Fastest_individual_communicationForm(ExpertReviewedForm):
"""
"""
diff --git a/seshat/apps/sc/migrations/0014_alter_administrative_level_comment_and_more.py b/seshat/apps/sc/migrations/0014_alter_administrative_level_comment_and_more.py
new file mode 100644
index 000000000..4c4e3c54a
--- /dev/null
+++ b/seshat/apps/sc/migrations/0014_alter_administrative_level_comment_and_more.py
@@ -0,0 +1,405 @@
+# Generated by Django 4.0.3 on 2024-12-06 18:51
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('core', '0068_rename_videoshapefile_cliopatria'),
+ ('sc', '0013_alter_administrative_level_polity_and_more'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='administrative_level',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='area_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='article',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='bridge',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='burial_site',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='calendar',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='canal',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='ceremonial_site',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='communal_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='courier',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='court',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='debt_and_credit_structure',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='drinking_water_supply_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='enclosure',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='entertainment_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='examination_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='fastest_individual_communication',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='fiction',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='food_storage_site',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='foreign_coin',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='formal_legal_code',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='full_time_bureaucrat',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='general_postal_service',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='geometrical_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='history',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='indigenous_coin',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='irrigation_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='judge',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='knowledge_or_information_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='largest_communication_distance',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='length_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='lists_tables_and_classification',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='market',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='merit_promotion',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='military_level',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='mines_or_quarry',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='mnemonic_device',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='non_phonetic_writing',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='nonwritten_record',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='occupational_complexity',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='other_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='other_special_purpose_site',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='other_utilitarian_public_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='paper_currency',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='philosophy',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='phonetic_alphabetic_writing',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_population',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polity_territory',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='population_of_the_largest_settlement',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='port',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='postal_station',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='practical_literature',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='precious_metal',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='professional_lawyer',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='professional_military_officer',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='professional_priesthood',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='professional_soldier',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='ra',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='religious_level',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='religious_literature',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='road',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='sacred_text',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='scientific_literature',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='script',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='settlement_hierarchy',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='source_of_support',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='special_purpose_house',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='special_purpose_site',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='specialized_government_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='store_of_wealth',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='symbolic_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='time_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='token',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='trading_emporia',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='utilitarian_public_building',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='volume_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='weight_measurement_system',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='written_record',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ ]
diff --git a/seshat/apps/sc/urls.py b/seshat/apps/sc/urls.py
index 738c3727e..6af37ab71 100644
--- a/seshat/apps/sc/urls.py
+++ b/seshat/apps/sc/urls.py
@@ -4,7 +4,8 @@
from .forms import Polity_territoryForm, Polity_populationForm, Population_of_the_largest_settlementForm, Settlement_hierarchyForm, Administrative_levelForm, Religious_levelForm, Military_levelForm, Professional_military_officerForm, Professional_soldierForm, Professional_priesthoodForm, Full_time_bureaucratForm, Examination_systemForm, Merit_promotionForm, Specialized_government_buildingForm, Formal_legal_codeForm, JudgeForm, CourtForm, Professional_lawyerForm, Irrigation_systemForm, Drinking_water_supply_systemForm, MarketForm, Food_storage_siteForm, RoadForm, BridgeForm, CanalForm, PortForm, Mines_or_quarryForm, Mnemonic_deviceForm, Nonwritten_recordForm, Written_recordForm, ScriptForm, Non_phonetic_writingForm, Phonetic_alphabetic_writingForm, Lists_tables_and_classificationForm, CalendarForm, Sacred_textForm, Religious_literatureForm, Practical_literatureForm, HistoryForm, PhilosophyForm, Scientific_literatureForm, FictionForm, ArticleForm, TokenForm, Precious_metalForm, Foreign_coinForm, Indigenous_coinForm, Paper_currencyForm, CourierForm, Postal_stationForm, General_postal_serviceForm, Communal_buildingForm, Utilitarian_public_buildingForm, Symbolic_buildingForm, Entertainment_buildingForm, Knowledge_or_information_buildingForm, Other_utilitarian_public_buildingForm, Special_purpose_siteForm, Ceremonial_siteForm, Burial_siteForm, Trading_emporiaForm, EnclosureForm, Length_measurement_systemForm, Area_measurement_systemForm, Volume_measurement_systemForm, Weight_measurement_systemForm, Time_measurement_systemForm, Geometrical_measurement_systemForm, Other_measurement_systemForm, Debt_and_credit_structureForm, Store_of_wealthForm, Source_of_supportForm, Occupational_complexityForm, Special_purpose_houseForm, Other_special_purpose_siteForm, Largest_communication_distanceForm, Fastest_individual_communicationForm
-from .views import dynamic_create_view, dynamic_update_view, dynamic_update_view_old, generic_list_view, generic_download, generic_metadata_download, dynamic_detail_view, confirm_delete_view, delete_object_view
+from seshat.apps.general.views import dynamic_create_view, dynamic_update_view, dynamic_update_view_old, generic_list_view, generic_download, generic_metadata_download, dynamic_detail_view, confirm_delete_view, delete_object_view
+
from .var_defs import sc_var_defs
@@ -88,9 +89,10 @@
(Other_special_purpose_site, Other_special_purpose_siteForm, 'other_special_purpose_site', 'Other Special Purpose Site', 'Special-purpose Sites', None),
(Largest_communication_distance, Largest_communication_distanceForm, 'largest_communication_distance', 'Largest Communication Distance', 'Social Complexity', 'Social Scale'),
(Fastest_individual_communication, Fastest_individual_communicationForm, 'fastest_individual_communication', 'Fastest Individual Communication', 'Social Complexity', 'Social Scale'),
-
]
+model_form_pairs_qugmented = [[a[0], a[1], a[2], a[2], a[3], a[4], a[5], 'sc'] for a in model_form_pairs]
+
urlpatterns = [
path('scvars/', views.scvars, name='scvars'),
@@ -107,19 +109,19 @@
path('download_csv_information/', views.download_csv_information,name='download_csv_information'),
]
-
-
#############
# Create URL patterns dynamically for each model-class pair: UPDATE
-for model_class, form_class, x_name, myvar, sec, subsec in model_form_pairs:
+for model_class, form_class, x_name, coded_value, myvar, sec, subsec, db_section in model_form_pairs_qugmented:
urlpatterns.append(
path(f'{x_name}/create/', dynamic_create_view, {
'form_class': form_class,
'x_name': x_name,
'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
'var_section': sec,
'var_subsection': subsec,
+ #'db_section': db_section,
}, name=f'{x_name}-create')
)
urlpatterns.append(
@@ -128,9 +130,11 @@
'model_class': model_class,
'x_name': x_name,
'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
'var_section': sec,
'var_subsection': subsec,
+ #'db_section': db_section,
'delete_url_name': x_name + "-confirm-delete",
}, name=f'{x_name}-updatenew')
)
@@ -140,9 +144,11 @@
'model_class': model_class,
'x_name': x_name,
'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
'var_section': sec,
'var_subsection': subsec,
+ #'db_section': db_section,
'delete_url_name': x_name + "-confirm-delete",
}, name=f'{x_name}-update')
)
@@ -152,6 +158,7 @@
'myvar': x_name,
'var_section': sec,
'var_subsection': subsec,
+ 'db_section': db_section,
'var_name_display': myvar,
}, name=f'{x_name}-detail')
)
@@ -159,9 +166,11 @@
path(f'{x_name}s_all/', generic_list_view, {
'model_class': model_class,
'var_name': x_name,
+ 'coded_value': coded_value,
'var_name_display': myvar,
'var_section': sec,
'var_subsection': subsec,
+ #'db_section': db_section,
'var_main_desc': sc_var_defs.get(x_name, f"NO Desc: {x_name}"),
}, name=f'{x_name}s_all')
@@ -190,6 +199,7 @@
'var_name_display': myvar,
'var_section': sec,
'var_subsection': subsec,
+ #'db_section': db_section,
'var_main_desc': sc_var_defs[x_name],
}, name=f'{x_name}-metadownload')
)
diff --git a/seshat/apps/sc/views.py b/seshat/apps/sc/views.py
index 50700b2ba..8aa7b0c5f 100644
--- a/seshat/apps/sc/views.py
+++ b/seshat/apps/sc/views.py
@@ -12315,6 +12315,9 @@ def dynamic_detail_view(request, pk, model_class, myvar, var_name_display, var_s
'var_subsection': var_subsection,
'db_section': 'sc',
}
+
+ if myvar == "human_sacrifice":
+ context['db_section'] = 'crisisdb'
#end_time = time.time()
#print('elapsed_time RT', end_time-start_time)
diff --git a/seshat/apps/seshat_api/filters/sc.py b/seshat/apps/seshat_api/filters/sc.py
index 3367c2a15..56d32e12f 100644
--- a/seshat/apps/seshat_api/filters/sc.py
+++ b/seshat/apps/seshat_api/filters/sc.py
@@ -290,6 +290,7 @@ class Meta:
fields = {
"road": ["exact"],
}
+
class BridgeFilter(SeshatCommonFilter, django_filters.FilterSet):
diff --git a/seshat/apps/seshat_api/urls.py b/seshat/apps/seshat_api/urls.py
index 2e9cf4db4..99d291113 100644
--- a/seshat/apps/seshat_api/urls.py
+++ b/seshat/apps/seshat_api/urls.py
@@ -15,13 +15,13 @@
SeshatTaskViewSet,
)
-router.register(r"account/profiles", ProfileViewSet, basename="profile")
+router.register(r"account/profiles", ProfileViewSet, basename="api_profile")
router.register(
r"account/seshat-experts",
SeshatExpertViewSet,
- basename="seshat-expert",
+ basename="api_seshat-expert",
)
-router.register(r"account/seshat-tasks", SeshatTaskViewSet, basename="seshat-task")
+router.register(r"account/seshat-tasks", SeshatTaskViewSet, basename="api_seshat-task")
# Register views for "core" app
@@ -54,63 +54,63 @@
router.register(
r"core/private-comments",
PrivateCommentsViewSet,
- basename="private-comment",
+ basename="api_private-comment",
)
router.register(
r"core/private-comments-parts",
PrivateCommentsPartsViewSet,
- basename="private-comment-part",
+ basename="api_private-comment-part",
)
-router.register(r"core/macro-regions", MacroRegionViewSet, basename="macro-region")
-router.register(r"core/regions", RegionViewSet, basename="region")
-router.register(r"core/ngas", NGAViewSet, basename="nga")
-router.register(r"core/polities", PolityViewSet, basename="polity")
-router.register(r"core/capitals", CapitalViewSet, basename="capital")
+router.register(r"core/macro-regions", MacroRegionViewSet, basename="api_macro-region")
+router.register(r"core/regions", RegionViewSet, basename="api_region")
+router.register(r"core/ngas", NGAViewSet, basename="api_nga")
+router.register(r"core/polities", PolityViewSet, basename="api_polity")
+router.register(r"core/capitals", CapitalViewSet, basename="api_capital")
router.register(
r"core/nga-polity-relations",
NGAPolityRelationsViewSet,
- basename="nga-polity-relation",
+ basename="api_nga-polity-relation",
)
-router.register(r"core/countries", CountryViewSet, basename="country")
-router.register(r"core/sections", SectionViewSet, basename="section")
-router.register(r"core/subsections", SubsectionViewSet, basename="subsection")
+router.register(r"core/countries", CountryViewSet, basename="api_country")
+router.register(r"core/sections", SectionViewSet, basename="api_section")
+router.register(r"core/subsections", SubsectionViewSet, basename="api_subsection")
router.register(
r"core/variable-hierarchies",
VariableHierarchyViewSet,
- basename="variable-hierarchy",
+ basename="api_variable-hierarchy",
)
-router.register(r"core/references", ReferenceViewSet, basename="reference")
-router.register(r"core/citations", CitationViewSet, basename="citation")
-router.register(r"core/comments", SeshatCommentViewSet, basename="seshat-comment")
+router.register(r"core/references", ReferenceViewSet, basename="api_reference")
+router.register(r"core/citations", CitationViewSet, basename="api_citation")
+router.register(r"core/comments", SeshatCommentViewSet, basename="api_seshat-comment")
router.register(
r"core/comment-parts",
SeshatCommentPartViewSet,
- basename="seshat-comment-part",
+ basename="api_seshat-comment-part",
)
router.register(
r"core/comment-parts-through-citations",
ScpThroughCtnViewSet,
- basename="comment-part-through-citation",
+ basename="api_comment-part-through-citation",
)
-#router.register(r"core/commons", SeshatCommonViewSet, basename="common")
-router.register(r"core/religions", ReligionViewSet, basename="religion")
+#router.register(r"core/commons", SeshatCommonViewSet, basename="api_common")
+router.register(r"core/religions", ReligionViewSet, basename="api_religion")
router.register(
r"core/cliopatria-shapefiles",
CliopatriaViewSet,
- basename="cliopatria-shapefile",
+ basename="api_cliopatria-shapefile",
)
router.register(
r"core/gadm-shapefiles",
GADMShapefileViewSet,
- basename="gadm-shapefile",
+ basename="api_gadm-shapefile",
)
router.register(
- r"core/gadm-countries", GADMCountriesViewSet, basename="gadm-country"
+ r"core/gadm-countries", GADMCountriesViewSet, basename="api_gadm-country"
)
router.register(
r"core/gadm-provinces",
GADMProvincesViewSet,
- basename="gadm-province",
+ basename="api_gadm-province",
)
@@ -145,120 +145,120 @@
DiseaseOutbreakViewSet,
)
-router.register(r"crisisdb/us-locations", USLocationViewSet, basename="us-location")
+router.register(r"crisisdb/us-locations", USLocationViewSet, basename="api_us-location")
router.register(
r"crisisdb/us-violence-subtypes",
USViolenceSubtypeViewSet,
- basename="us-violence-subtype",
+ basename="api_us-violence-subtype",
)
router.register(
r"crisisdb/us-violence-data-sources",
USViolenceDataSourceViewSet,
- basename="us-violence-data-source",
+ basename="api_us-violence-data-source",
)
-router.register(r"crisisdb/us-violences", USViolenceViewSet, basename="us-violence")
+router.register(r"crisisdb/us-violences", USViolenceViewSet, basename="api_us-violence")
router.register(
r"crisisdb/crisis-consequences",
CrisisConsequenceViewSet,
- basename="crisis-consequence",
+ basename="api_crisis-consequence",
)
router.register(
r"crisisdb/power-transitions",
PowerTransitionViewSet,
- basename="power-transition",
+ basename="api_power-transition",
)
router.register(
r"crisisdb/human-sacrifices",
HumanSacrificeViewSet,
- basename="human-sacrifice",
+ basename="api_human-sacrifice",
)
router.register(
r"crisisdb/external-conflicts",
ExternalConflictViewSet,
- basename="external-conflict",
+ basename="api_external-conflict",
)
router.register(
r"crisisdb/external-conflict-sides",
ExternalConflictSideViewSet,
- basename="external-conflict-side",
+ basename="api_external-conflict-side",
)
router.register(
r"crisisdb/agricultural-populations",
AgriculturalPopulationViewSet,
- basename="agricultural-population",
+ basename="api_agricultural-population",
)
-router.register(r"crisisdb/arable-lands", ArableLandViewSet, basename="arable-land")
+router.register(r"crisisdb/arable-lands", ArableLandViewSet, basename="api_arable-land")
router.register(
r"crisisdb/arable-land-per-farmer",
ArableLandPerFarmerViewSet,
- basename="arable-land-per-farmer",
+ basename="api_arable-land-per-farmer",
)
router.register(
r"crisisdb/gross-grain-shared-per-agricultural-populations",
GrossGrainSharedPerAgriculturalPopulationViewSet,
- basename="gross-grain-shared-per-agricultural-population",
+ basename="api_gross-grain-shared-per-agricultural-population",
)
router.register(
r"crisisdb/net-grain-shared-per-agricultural-populations",
NetGrainSharedPerAgriculturalPopulationViewSet,
- basename="net-grain-shared-per-agricultural-population",
+ basename="api_net-grain-shared-per-agricultural-population",
)
-router.register(r"crisisdb/surpluses", SurplusViewSet, basename="surplus")
+router.register(r"crisisdb/surpluses", SurplusViewSet, basename="api_surplus")
router.register(
r"crisisdb/military-expenses",
MilitaryExpenseViewSet,
- basename="military-expense",
+ basename="api_military-expense",
)
router.register(
r"crisisdb/silver-inflows",
SilverInflowViewSet,
- basename="silver-inflow",
+ basename="api_silver-inflow",
)
router.register(
r"crisisdb/silver-stocks",
SilverStockViewSet,
- basename="silver-stock",
+ basename="api_silver-stock",
)
router.register(
r"crisisdb/total-populations",
TotalPopulationViewSet,
- basename="total-population",
+ basename="api_total-population",
)
router.register(
r"crisisdb/gdp-per-capitas",
GDPPerCapitaViewSet,
- basename="gdp-per-capita",
+ basename="api_gdp-per-capita",
)
router.register(
r"crisisdb/drought-events",
DroughtEventViewSet,
- basename="drought-event",
+ basename="api_drought-event",
)
router.register(
r"crisisdb/locust-events",
LocustEventViewSet,
- basename="locust-event",
+ basename="api_locust-event",
)
router.register(
r"crisisdb/socioeconomic-turmoil-events",
SocioeconomicTurmoilEventViewSet,
- basename="socioeconomic-turmoil-event",
+ basename="api_socioeconomic-turmoil-event",
)
router.register(
r"crisisdb/crop-failure-events",
CropFailureEventViewSet,
- basename="crop-failure-event",
+ basename="api_crop-failure-event",
)
router.register(
r"crisisdb/famine-events",
FamineEventViewSet,
- basename="famine-event",
+ basename="api_famine-event",
)
router.register(
r"crisisdb/disease-outbreaks",
DiseaseOutbreakViewSet,
- basename="disease-outbreak",
+ basename="api_disease-outbreak",
)
@@ -296,118 +296,118 @@
router.register(
r"general/polity-research-assistants",
PolityResearchAssistantViewSet,
- basename="polity-research-assistant",
+ basename="api_polity-research-assistant",
)
router.register(
r"general/polity-original-names",
PolityOriginalNameViewSet,
- basename="polity-original-name",
+ basename="api_polity-original-name",
)
router.register(
r"general/polity-alternative-names",
PolityAlternativeNameViewSet,
- basename="polity-alternative-name",
+ basename="api_polity-alternative-name",
)
router.register(
- r"general/polity-durations", PolityDurationViewSet, basename="polity-duration"
+ r"general/polity-durations", PolityDurationViewSet, basename="api_polity-duration"
)
router.register(
- r"general/polity-peak-years", PolityPeakYearsViewSet, basename="polity-peak-years"
+ r"general/polity-peak-years", PolityPeakYearsViewSet, basename="api_polity-peak-years"
)
router.register(
r"general/polity-degree-of-centralizations",
PolityDegreeOfCentralizationViewSet,
- basename="polity-degree-of-centralization",
+ basename="api_polity-degree-of-centralization",
)
router.register(
r"general/polity-suprapolities",
PolitySuprapolityRelationsViewSet,
- basename="polity-suprapolity",
+ basename="api_polity-suprapolity",
)
router.register(
r"general/polity-utm-timezones",
PolityUTMZoneViewSet,
- basename="polity-utm-timezone",
+ basename="api_polity-utm-timezone",
)
router.register(
- r"general/polity-capitals", PolityCapitalViewSet, basename="polity-capital"
+ r"general/polity-capitals", PolityCapitalViewSet, basename="api_polity-capital"
)
router.register(
- r"general/polity-languages", PolityLanguageViewSet, basename="polity-language"
+ r"general/polity-languages", PolityLanguageViewSet, basename="api_polity-language"
)
router.register(
r"general/polity-linguistic-families",
PolityLinguisticFamilyViewSet,
- basename="polity-linguistic-family",
+ basename="api_polity-linguistic-family",
)
router.register(
r"general/polity-language-genuses",
PolityLanguageGenusViewSet,
- basename="polity-language-genus",
+ basename="api_polity-language-genus",
)
router.register(
r"general/polity-religion-genuses",
PolityReligionGenusViewSet,
- basename="polity-religion-genus",
+ basename="api_polity-religion-genus",
)
router.register(
r"general/polity-religion-families",
PolityReligionFamilyViewSet,
- basename="polity-religion-family",
+ basename="api_polity-religion-family",
)
router.register(
- r"general/polity-religions", PolityReligionViewSet, basename="polity-religion"
+ r"general/polity-religions", PolityReligionViewSet, basename="api_polity-religion"
)
router.register(
r"general/polity-relationship-to-preceding-entities",
PolityRelationshipToPrecedingEntityViewSet,
- basename="polity-relationship-to-preceding-entity",
+ basename="api_polity-relationship-to-preceding-entity",
)
router.register(
r"general/polity-preceding-entities",
PolityPrecedingEntityViewSet,
- basename="polity-preceding-entity",
+ basename="api_polity-preceding-entity",
)
router.register(
r"general/polity-succeeding-entities",
PolitySucceedingEntityViewSet,
- basename="polity-succeeding-entity",
+ basename="api_polity-succeeding-entity",
)
router.register(
r"general/polity-supracultural-entities",
PolitySupraculturalEntityViewSet,
- basename="polity-supracultural-entity",
+ basename="api_polity-supracultural-entity",
)
router.register(
r"general/polity-scale-of-supracultural-interactions",
PolityScaleOfSupraculturalInteractionViewSet,
- basename="polity-scale-of-supracultural-interaction",
+ basename="api_polity-scale-of-supracultural-interaction",
)
router.register(
r"general/polity-alternate-religion-genuses",
PolityAlternateReligionGenusViewSet,
- basename="polity-alternate-religion-genus",
+ basename="api_polity-alternate-religion-genus",
)
router.register(
r"general/polity-alternate-religion-families",
PolityAlternateReligionFamilyViewSet,
- basename="polity-alternate-religion-family",
+ basename="api_polity-alternate-religion-family",
)
router.register(
r"general/polity-alternate-religions",
PolityAlternateReligionViewSet,
- basename="polity-alternate-religion",
+ basename="api_polity-alternate-religion",
)
router.register(
- r"general/polity-experts", PolityExpertViewSet, basename="polity-expert"
+ r"general/polity-experts", PolityExpertViewSet, basename="api_polity-expert"
)
router.register(
- r"general/polity-editors", PolityEditorViewSet, basename="polity-editor"
+ r"general/polity-editors", PolityEditorViewSet, basename="api_polity-editor"
)
router.register(
r"general/polity-religious-traditions",
PolityReligiousTraditionViewSet,
- basename="polity-religious-tradition",
+ basename="api_polity-religious-tradition",
)
@@ -440,105 +440,105 @@
router.register(
r"rt/widespread-religions",
WidespreadReligionViewSet,
- basename="widespread-religion",
+ basename="api_widespread-religion",
)
router.register(
r"rt/official-religions",
OfficialReligionViewSet,
- basename="official-religion",
+ basename="api_official-religion",
)
router.register(
- r"rt/elites-religions", ElitesReligionViewSet, basename="elites-religion"
+ r"rt/elites-religions", ElitesReligionViewSet, basename="api_elites-religion"
)
router.register(
r"rt/theological-syncretism-of-different-religions",
TheoSyncDifRelViewSet,
- basename="theological-syncretism-of-different-religions",
+ basename="api_theological-syncretism-of-different-religions",
)
router.register(
r"rt/syncretism-of-religious-practices-at-the-level-of-individual-believers",
SyncRelPraIndBeliViewSet,
- basename="syncretism-of-religious-practices-at-the-level-of-individual-believers",
+ basename="api_syncretism-of-religious-practices-at-the-level-of-individual-believers",
)
router.register(
r"rt/religious-fragmentations",
ReligiousFragmentationViewSet,
- basename="religious-fragmentation",
+ basename="api_religious-fragmentation",
)
router.register(
r"rt/frequency-of-governmental-violence-against-religious-groups",
GovVioFreqRelGrpViewSet,
- basename="frequency-of-governmental-violence-against-religious-groups",
+ basename="api_frequency-of-governmental-violence-against-religious-groups",
)
router.register(
r"rt/government-restrictions-on-public-worships",
GovResPubWorViewSet,
- basename="government-restrictions-on-public-worships",
+ basename="api_government-restrictions-on-public-worships",
)
router.register(
r"rt/government-restrictions-on-public-proselytizings",
GovResPubProsViewSet,
- basename="government-restrictions-on-public-proselytizings",
+ basename="api_government-restrictions-on-public-proselytizings",
)
router.register(
r"rt/government-restrictions-on-conversions",
GovResConvViewSet,
- basename="government-restrictions-on-conversions",
+ basename="api_government-restrictions-on-conversions",
)
router.register(
r"rt/government-pressure-to-converts",
GovPressConvViewSet,
- basename="government-pressure-to-converts",
+ basename="api_government-pressure-to-converts",
)
router.register(
r"rt/government-restrictions-on-property-ownership-for-adherents-of-and-religious-groups",
GovResPropOwnForRelGrpViewSet,
- basename="government-restrictions-on-property-ownership-for-adherents-of-and-religious-groups",
+ basename="api_government-restrictions-on-property-ownership-for-adherents-of-and-religious-groups",
)
router.register(
r"rt/taxes-based-on-religious-adherence-or-on-religious-activities-and-institutions",
TaxRelAdhActInsViewSet,
- basename="taxes-based-on-religious-adherence-or-on-religious-activities-and-institutions",
+ basename="api_taxes-based-on-religious-adherence-or-on-religious-activities-and-institutions",
)
router.register(
r"rt/governmental-obligations-for-religious-groups-to-apply-for-official-recognitions",
GovOblRelGrpOfcRecoViewSet,
- basename="governmental-obligations-for-religious-groups-to-apply-for-official-recognitions",
+ basename="api_governmental-obligations-for-religious-groups-to-apply-for-official-recognitions",
)
router.register(
r"rt/government-restrictions-on-construction-of-religious-buildings",
GovResConsRelBuilViewSet,
- basename="government-restrictions-on-construction-of-religious-buildings",
+ basename="api_government-restrictions-on-construction-of-religious-buildings",
)
router.register(
r"rt/government-restrictions-on-religious-educations",
GovResRelEduViewSet,
- basename="government-restrictions-on-religious-educations",
+ basename="api_government-restrictions-on-religious-educations",
)
router.register(
r"rt/government-restrictions-on-circulation-of-religious-literatures",
GovResCirRelLitViewSet,
- basename="government-restrictions-on-circulation-of-religious-literatures",
+ basename="api_government-restrictions-on-circulation-of-religious-literatures",
)
router.register(
r"rt/government-discrimination-against-religious-groups-taking-up-certain-occupations-or-functions",
GovDisRelGrpOccFunViewSet,
- basename="government-discrimination-against-religious-groups-taking-up-certain-occupations-or-functions",
+ basename="api_government-discrimination-against-religious-groups-taking-up-certain-occupations-or-functions",
)
router.register(
r"rt/frequency-of-societal-violence-against-religious-groups",
SocVioFreqRelGrpViewSet,
- basename="frequency-of-societal-violence-against-religious-groups",
+ basename="api_frequency-of-societal-violence-against-religious-groups",
)
router.register(
r"rt/societal-discrimination-against-religious-groups-taking-up-certain-occupations-or-functions",
SocDisRelGrpOccFunViewSet,
- basename="societal-discrimination-against-religious-groups-taking-up-certain-occupations-or-functions",
+ basename="api_societal-discrimination-against-religious-groups-taking-up-certain-occupations-or-functions",
)
router.register(
r"rt/societal-pressure-to-convert-or-against-conversions",
GovPressConvForAgaViewSet,
- basename="societal-pressure-to-convert-or-against-conversions",
+ basename="api_societal-pressure-to-convert-or-against-conversions",
)
@@ -626,282 +626,282 @@
)
router.register(
- r"sc/research-assistants", RAViewSet, basename="research-assistant"
+ r"sc/research-assistants", RAViewSet, basename="api_research-assistant"
)
router.register(
- r"sc/polity-territories", PolityTerritoryViewSet, basename="polity-territory"
+ r"sc/polity-territories", PolityTerritoryViewSet, basename="api_polity-territory"
)
router.register(
r"sc/polity-populations",
PolityPopulationViewSet,
- basename="polity-population",
+ basename="api_polity-population",
)
router.register(
r"sc/population-of-the-largest-settlements",
PopulationOfTheLargestSettlementViewSet,
- basename="population-of-the-largest-settlement",
+ basename="api_population-of-the-largest-settlement",
)
router.register(
r"sc/settlement-hierarchies",
SettlementHierarchyViewSet,
- basename="settlement-hierarchy",
+ basename="api_settlement-hierarchy",
)
router.register(
r"sc/administrative-levels",
AdministrativeLevelViewSet,
- basename="administrative-level",
+ basename="api_administrative-level",
)
router.register(
- r"sc/religious-levels", ReligiousLevelViewSet, basename="religious-level"
+ r"sc/religious-levels", ReligiousLevelViewSet, basename="api_religious-level"
)
router.register(
- r"sc/military-levels", MilitaryLevelViewSet, basename="military-level"
+ r"sc/military-levels", MilitaryLevelViewSet, basename="api_military-level"
)
router.register(
r"sc/professional-military-officers",
ProfessionalMilitaryOfficerViewSet,
- basename="professional-military-officer",
+ basename="api_professional-military-officer",
)
router.register(
r"sc/professional-soldiers",
ProfessionalSoldierViewSet,
- basename="professional-soldier",
+ basename="api_professional-soldier",
)
router.register(
r"sc/professional-priesthoods",
ProfessionalPriesthoodViewSet,
- basename="professional-priesthood",
+ basename="api_professional-priesthood",
)
router.register(
r"sc/full-time-bureaucrats",
FullTimeBureaucratViewSet,
- basename="full-time-bureaucrat",
+ basename="api_full-time-bureaucrat",
)
router.register(
r"sc/examination-systems",
ExaminationSystemViewSet,
- basename="examination-system",
+ basename="api_examination-system",
)
router.register(
- r"sc/merit-promotions", MeritPromotionViewSet, basename="merit-promotion"
+ r"sc/merit-promotions", MeritPromotionViewSet, basename="api_merit-promotion"
)
router.register(
r"sc/specialized-government-buildings",
SpecializedGovernmentBuildingViewSet,
- basename="specialized-government-building",
+ basename="api_specialized-government-building",
)
router.register(
- r"sc/formal-legal-codes", FormalLegalCodeViewSet, basename="formal-legal-code"
+ r"sc/formal-legal-codes", FormalLegalCodeViewSet, basename="api_formal-legal-code"
)
-router.register(r"sc/judges", JudgeViewSet, basename="judge")
-router.register(r"sc/courts", CourtViewSet, basename="court")
+router.register(r"sc/judges", JudgeViewSet, basename="api_judge")
+router.register(r"sc/courts", CourtViewSet, basename="api_court")
router.register(
r"sc/professional-lawyers",
ProfessionalLawyerViewSet,
- basename="professional-lawyer",
+ basename="api_professional-lawyer",
)
router.register(
r"sc/irrigation-systems",
IrrigationSystemViewSet,
- basename="irrigation-system",
+ basename="api_irrigation-system",
)
router.register(
r"sc/drinking-water-supplies",
DrinkingWaterSupplySystemViewSet,
- basename="drinking-water-supply-system",
+ basename="api_drinking-water-supply-system",
)
-router.register(r"sc/markets", MarketViewSet, basename="market")
+router.register(r"sc/markets", MarketViewSet, basename="api_market")
router.register(
- r"sc/food-storage-sites", FoodStorageSiteViewSet, basename="food-storage-site"
+ r"sc/food-storage-sites", FoodStorageSiteViewSet, basename="api_food-storage-site"
)
-router.register(r"sc/roads", RoadViewSet, basename="road")
-router.register(r"sc/bridges", BridgeViewSet, basename="bridge")
-router.register(r"sc/canals", CanalViewSet, basename="canal")
-router.register(r"sc/ports", PortViewSet, basename="port")
+router.register(r"sc/roads", RoadViewSet, basename="api_road")
+router.register(r"sc/bridges", BridgeViewSet, basename="api_bridge")
+router.register(r"sc/canals", CanalViewSet, basename="api_canal")
+router.register(r"sc/ports", PortViewSet, basename="api_port")
router.register(
- r"sc/mines-or-quarries", MinesOrQuarryViewSet, basename="mines-or-quarry"
+ r"sc/mines-or-quarries", MinesOrQuarryViewSet, basename="api_mines-or-quarry"
)
router.register(
- r"sc/mnemonic-devices", MnemonicDeviceViewSet, basename="mnemonic-device"
+ r"sc/mnemonic-devices", MnemonicDeviceViewSet, basename="api_mnemonic-device"
)
router.register(
r"sc/nonwritten-records",
NonwrittenRecordViewSet,
- basename="nonwritten-record",
+ basename="api_nonwritten-record",
)
router.register(
- r"sc/written-records", WrittenRecordViewSet, basename="written-record"
+ r"sc/written-records", WrittenRecordViewSet, basename="api_written-record"
)
-router.register(r"sc/scripts", ScriptViewSet, basename="script")
+router.register(r"sc/scripts", ScriptViewSet, basename="api_script")
router.register(
r"sc/non-phonetic-writings",
NonPhoneticWritingViewSet,
- basename="non-phonetic-writing",
+ basename="api_non-phonetic-writing",
)
router.register(
r"sc/phonetic-alphabetic-writings",
PhoneticAlphabeticWritingViewSet,
- basename="phonetic-alphabetic-writing",
+ basename="api_phonetic-alphabetic-writing",
)
router.register(
r"sc/lists-tables-and-classifications",
ListsTablesAndClassificationViewSet,
- basename="lists-tables-and-classifications",
+ basename="api_lists-tables-and-classifications",
)
-router.register(r"sc/calendars", CalendarViewSet, basename="calendar")
-router.register(r"sc/sacred-texts", SacredTextViewSet, basename="sacred-text")
+router.register(r"sc/calendars", CalendarViewSet, basename="api_calendar")
+router.register(r"sc/sacred-texts", SacredTextViewSet, basename="api_sacred-text")
router.register(
r"sc/religious-literatures",
ReligiousLiteratureViewSet,
- basename="religious-literature",
+ basename="api_religious-literature",
)
router.register(
r"sc/practical-literatures",
PracticalLiteratureViewSet,
- basename="practical-literature",
+ basename="api_practical-literature",
)
-router.register(r"sc/histories", HistoryViewSet, basename="history")
-router.register(r"sc/philosophies", PhilosophyViewSet, basename="philosophy")
+router.register(r"sc/histories", HistoryViewSet, basename="api_history")
+router.register(r"sc/philosophies", PhilosophyViewSet, basename="api_philosophy")
router.register(
r"sc/scientific-literatures",
ScientificLiteratureViewSet,
- basename="scientific-literature",
+ basename="api_scientific-literature",
)
-router.register(r"sc/fictions", FictionViewSet, basename="fiction")
-router.register(r"sc/articles", ArticleViewSet, basename="article")
-router.register(r"sc/tokens", TokenViewSet, basename="token")
+router.register(r"sc/fictions", FictionViewSet, basename="api_fiction")
+router.register(r"sc/articles", ArticleViewSet, basename="api_article")
+router.register(r"sc/tokens", TokenViewSet, basename="api_token")
router.register(
- r"sc/precious-metals", PreciousMetalViewSet, basename="precious-metal"
+ r"sc/precious-metals", PreciousMetalViewSet, basename="api_precious-metal"
)
-router.register(r"sc/foreign-coins", ForeignCoinViewSet, basename="foreign-coin")
+router.register(r"sc/foreign-coins", ForeignCoinViewSet, basename="api_foreign-coin")
router.register(
- r"sc/indigenous-coins", IndigenousCoinViewSet, basename="indigenous-coin"
+ r"sc/indigenous-coins", IndigenousCoinViewSet, basename="api_indigenous-coin"
)
router.register(
- r"sc/paper-currencies", PaperCurrencyViewSet, basename="paper-currency"
+ r"sc/paper-currencies", PaperCurrencyViewSet, basename="api_paper-currency"
)
-router.register(r"sc/couriers", CourierViewSet, basename="courier")
+router.register(r"sc/couriers", CourierViewSet, basename="api_courier")
router.register(
- r"sc/postal-stations", PostalStationViewSet, basename="postal-station"
+ r"sc/postal-stations", PostalStationViewSet, basename="api_postal-station"
)
router.register(
r"sc/general-postal-services",
GeneralPostalServiceViewSet,
- basename="general-postal-service",
+ basename="api_general-postal-service",
)
router.register(
r"sc/communal-buildings",
CommunalBuildingViewSet,
- basename="communal-building",
+ basename="api_communal-building",
)
router.register(
r"sc/utilitarian-public-buildings",
UtilitarianPublicBuildingViewSet,
- basename="utilitarian-public-building",
+ basename="api_utilitarian-public-building",
)
router.register(
r"sc/symbolic-buildings",
SymbolicBuildingViewSet,
- basename="symbolic-building",
+ basename="api_symbolic-building",
)
router.register(
r"sc/entertainment-buildings",
EntertainmentBuildingViewSet,
- basename="entertainment-building",
+ basename="api_entertainment-building",
)
router.register(
r"sc/knowledge-or-information-buildings",
KnowledgeOrInformationBuildingViewSet,
- basename="knowledge-or-information-building",
+ basename="api_knowledge-or-information-building",
)
router.register(
r"sc/other-utilitarian-public-buildings",
OtherUtilitarianPublicBuildingViewSet,
- basename="other-utilitarian-public-building",
+ basename="api_other-utilitarian-public-building",
)
router.register(
r"sc/special-purpose-sites",
SpecialPurposeSiteViewSet,
- basename="special-purpose-site",
+ basename="api_special-purpose-site",
)
router.register(
- r"sc/ceremonial-sites", CeremonialSiteViewSet, basename="ceremonial-site"
+ r"sc/ceremonial-sites", CeremonialSiteViewSet, basename="api_ceremonial-site"
)
-router.register(r"sc/burial-sites", BurialSiteViewSet, basename="burial-site")
+router.register(r"sc/burial-sites", BurialSiteViewSet, basename="api_burial-site")
router.register(
- r"sc/trading-emporia", TradingEmporiaViewSet, basename="trading-emporium"
+ r"sc/trading-emporia", TradingEmporiaViewSet, basename="api_trading-emporium"
)
-router.register(r"sc/enclosures", EnclosureViewSet, basename="enclosure")
+router.register(r"sc/enclosures", EnclosureViewSet, basename="api_enclosure")
router.register(
r"sc/length-measurement-systems",
LengthMeasurementSystemViewSet,
- basename="length-measurement-system",
+ basename="api_length-measurement-system",
)
router.register(
r"sc/area-measurement-systems",
AreaMeasurementSystemViewSet,
- basename="area-measurement-system",
+ basename="api_area-measurement-system",
)
router.register(
r"sc/volume-measurement-systems",
VolumeMeasurementSystemViewSet,
- basename="volume-measurement-system",
+ basename="api_volume-measurement-system",
)
router.register(
r"sc/weight-measurement-systems",
WeightMeasurementSystemViewSet,
- basename="weight-measurement-system",
+ basename="api_weight-measurement-system",
)
router.register(
r"sc/time-measurement-systems",
TimeMeasurementSystemViewSet,
- basename="time-measurement-system",
+ basename="api_time-measurement-system",
)
router.register(
r"sc/geometrical-measurement-systems",
GeometricalMeasurementSystemViewSet,
- basename="geometrical-measurement-system",
+ basename="api_geometrical-measurement-system",
)
router.register(
r"sc/other-measurement-systems",
OtherMeasurementSystemViewSet,
- basename="other-measurement-system",
+ basename="api_other-measurement-system",
)
router.register(
r"sc/debt-and-credit-structures",
DebtAndCreditStructureViewSet,
- basename="debt-and-credit-structure",
+ basename="api_debt-and-credit-structure",
)
router.register(
- r"sc/stores-of-wealth", StoreOfWealthViewSet, basename="store-of-wealth"
+ r"sc/stores-of-wealth", StoreOfWealthViewSet, basename="api_store-of-wealth"
)
router.register(
- r"sc/sources-of-support", SourceOfSupportViewSet, basename="source-of-support"
+ r"sc/sources-of-support", SourceOfSupportViewSet, basename="api_source-of-support"
)
router.register(
r"sc/occupational-complexities",
OccupationalComplexityViewSet,
- basename="occupational-complexity",
+ basename="api_occupational-complexity",
)
router.register(
r"sc/special-purpose-houses",
SpecialPurposeHouseViewSet,
- basename="special-purpose-house",
+ basename="api_special-purpose-house",
)
router.register(
r"sc/other-special-purpose-sites",
OtherSpecialPurposeSiteViewSet,
- basename="other-special-purpose-site",
+ basename="api_other-special-purpose-site",
)
router.register(
r"sc/largest-communication-distances",
LargestCommunicationDistanceViewSet,
- basename="largest-communication-distance",
+ basename="api_largest-communication-distance",
)
router.register(
r"sc/fastest-individual-communications",
FastestIndividualCommunicationViewSet,
- basename="fastest-individual-communication",
+ basename="api_fastest-individual-communication",
)
@@ -959,113 +959,113 @@
ChainmailViewSet,
)
-router.register(r"wf/long-walls", LongWallViewSet, basename="long-wall")
-router.register(r"wf/coppers", CopperViewSet, basename="copper")
-router.register(r"wf/bronzes", BronzeViewSet, basename="bronze")
-router.register(r"wf/irons", IronViewSet, basename="iron")
-router.register(r"wf/steels", SteelViewSet, basename="steel")
-router.register(r"wf/javelins", JavelinViewSet, basename="javelin")
-router.register(r"wf/atlatls", AtlatlViewSet, basename="atlatl")
-router.register(r"wf/slings", SlingViewSet, basename="sling")
-router.register(r"wf/self-bows", SelfBowViewSet, basename="self-bow")
+router.register(r"wf/long-walls", LongWallViewSet, basename="api_long-wall")
+router.register(r"wf/coppers", CopperViewSet, basename="api_copper")
+router.register(r"wf/bronzes", BronzeViewSet, basename="api_bronze")
+router.register(r"wf/irons", IronViewSet, basename="api_iron")
+router.register(r"wf/steels", SteelViewSet, basename="api_steel")
+router.register(r"wf/javelins", JavelinViewSet, basename="api_javelin")
+router.register(r"wf/atlatls", AtlatlViewSet, basename="api_atlatl")
+router.register(r"wf/slings", SlingViewSet, basename="api_sling")
+router.register(r"wf/self-bows", SelfBowViewSet, basename="api_self-bow")
router.register(
- r"wf/composite-bows", CompositeBowViewSet, basename="composite-bow"
+ r"wf/composite-bows", CompositeBowViewSet, basename="api_composite-bow"
)
-router.register(r"wf/crossbows", CrossbowViewSet, basename="crossbow")
+router.register(r"wf/crossbows", CrossbowViewSet, basename="api_crossbow")
router.register(
r"wf/tension-siege-engines",
TensionSiegeEngineViewSet,
- basename="tension-siege-engine",
+ basename="api_tension-siege-engine",
)
router.register(
r"wf/sling-siege-engines",
SlingSiegeEngineViewSet,
- basename="sling-siege-engine",
+ basename="api_sling-siege-engine",
)
router.register(
r"wf/gunpowder-siege-artilleries",
GunpowderSiegeArtilleryViewSet,
- basename="gunpowder-siege-artillery",
+ basename="api_gunpowder-siege-artillery",
)
router.register(
- r"wf/handheld-firearms", HandheldFirearmViewSet, basename="handheld-firearm"
+ r"wf/handheld-firearms", HandheldFirearmViewSet, basename="api_handheld-firearm"
)
-router.register(r"wf/war-clubs", WarClubViewSet, basename="war-club")
-router.register(r"wf/battle-axes", BattleAxeViewSet, basename="battle-axe")
-router.register(r"wf/daggers", DaggerViewSet, basename="dagger")
-router.register(r"wf/swords", SwordViewSet, basename="sword")
-router.register(r"wf/spears", SpearViewSet, basename="spear")
-router.register(r"wf/polearms", PolearmViewSet, basename="polearm")
-router.register(r"wf/dogs", DogViewSet, basename="dog")
-router.register(r"wf/donkeys", DonkeyViewSet, basename="donkey")
-router.register(r"wf/horses", HorseViewSet, basename="horse")
-router.register(r"wf/camels", CamelViewSet, basename="camel")
-router.register(r"wf/elephants", ElephantViewSet, basename="elephant")
-router.register(r"wf/wood-bark-etc", WoodBarkEtcViewSet, basename="wood-bark-etc")
-router.register(r"wf/leathers", LeatherClothViewSet, basename="leather-cloth")
-router.register(r"wf/shields", ShieldViewSet, basename="shield")
-router.register(r"wf/helmets", HelmetViewSet, basename="helmet")
-router.register(r"wf/breastplates", BreastplateViewSet, basename="breastplate")
+router.register(r"wf/war-clubs", WarClubViewSet, basename="api_war-club")
+router.register(r"wf/battle-axes", BattleAxeViewSet, basename="api_battle-axe")
+router.register(r"wf/daggers", DaggerViewSet, basename="api_dagger")
+router.register(r"wf/swords", SwordViewSet, basename="api_sword")
+router.register(r"wf/spears", SpearViewSet, basename="api_spear")
+router.register(r"wf/polearms", PolearmViewSet, basename="api_polearm")
+router.register(r"wf/dogs", DogViewSet, basename="api_dog")
+router.register(r"wf/donkeys", DonkeyViewSet, basename="api_donkey")
+router.register(r"wf/horses", HorseViewSet, basename="api_horse")
+router.register(r"wf/camels", CamelViewSet, basename="api_camel")
+router.register(r"wf/elephants", ElephantViewSet, basename="api_elephant")
+router.register(r"wf/wood-bark-etc", WoodBarkEtcViewSet, basename="api_wood-bark-etc")
+router.register(r"wf/leathers", LeatherClothViewSet, basename="api_leather-cloth")
+router.register(r"wf/shields", ShieldViewSet, basename="api_shield")
+router.register(r"wf/helmets", HelmetViewSet, basename="api_helmet")
+router.register(r"wf/breastplates", BreastplateViewSet, basename="api_breastplate")
router.register(
- r"wf/limb-protections", LimbProtectionViewSet, basename="limb-protection"
+ r"wf/limb-protections", LimbProtectionViewSet, basename="api_limb-protection"
)
-router.register(r"wf/scaled-armors", ScaledArmorViewSet, basename="scaled-armor")
+router.register(r"wf/scaled-armors", ScaledArmorViewSet, basename="api_scaled-armor")
router.register(
- r"wf/laminar-armors", LaminarArmorViewSet, basename="laminar-armor"
+ r"wf/laminar-armors", LaminarArmorViewSet, basename="api_laminar-armor"
)
-router.register(r"wf/plate-armors", PlateArmorViewSet, basename="plate-armor")
+router.register(r"wf/plate-armors", PlateArmorViewSet, basename="api_plate-armor")
router.register(
r"wf/small-vessel-canoe-etc",
SmallVesselsCanoesEtcViewSet,
- basename="small-vessel-canoe-etc",
+ basename="api_small-vessel-canoe-etc",
)
router.register(
r"wf/merchant-ship-pressed-into-service",
MerchantShipPressedIntoServiceViewSet,
- basename="merchant-ship-pressed-into-service",
+ basename="api_merchant-ship-pressed-into-service",
)
router.register(
r"wf/specialized-military-vessels",
SpecializedMilitaryVesselViewSet,
- basename="specialized-military-vessel",
+ basename="api_specialized-military-vessel",
)
router.register(
r"wf/settlement-in-defensive-positions",
SettlementInADefensivePositionViewSet,
- basename="settlement-in-defensive-position",
+ basename="api_settlement-in-defensive-position",
)
router.register(
- r"wf/wooden-palisades", WoodenPalisadeViewSet, basename="wooden-palisade"
+ r"wf/wooden-palisades", WoodenPalisadeViewSet, basename="api_wooden-palisade"
)
router.register(
- r"wf/earth-ramparts", EarthRampartViewSet, basename="earth-rampart"
+ r"wf/earth-ramparts", EarthRampartViewSet, basename="api_earth-rampart"
)
-router.register(r"wf/ditches", DitchViewSet, basename="ditch")
-router.register(r"wf/moats", MoatViewSet, basename="moat")
+router.register(r"wf/ditches", DitchViewSet, basename="api_ditch")
+router.register(r"wf/moats", MoatViewSet, basename="api_moat")
router.register(
r"wf/stone-walls-non-mortared",
StoneWallsNonMortaredViewSet,
- basename="stone-walls-non-mortared",
+ basename="api_stone-walls-non-mortared",
)
router.register(
r"wf/stone-walls-mortared",
StoneWallsMortaredViewSet,
- basename="stone-walls-mortared",
+ basename="api_stone-walls-mortared",
)
router.register(
- r"wf/fortified-camps", FortifiedCampViewSet, basename="fortified-camp"
+ r"wf/fortified-camps", FortifiedCampViewSet, basename="api_fortified-camp"
)
router.register(
r"wf/complex-fortifications",
ComplexFortificationViewSet,
- basename="complex-fortification",
+ basename="api_complex-fortification",
)
router.register(
r"wf/modern-fortifications",
ModernFortificationViewSet,
- basename="modern-fortification",
+ basename="api_modern-fortification",
)
-router.register(r"wf/chainmails", ChainmailViewSet, basename="chainmail")
+router.register(r"wf/chainmails", ChainmailViewSet, basename="api_chainmail")
# Register all the views with the router
diff --git a/seshat/apps/wf/forms.py b/seshat/apps/wf/forms.py
index 193e81572..0f315f5da 100644
--- a/seshat/apps/wf/forms.py
+++ b/seshat/apps/wf/forms.py
@@ -12,36 +12,39 @@
from django.template.defaulttags import register
-commonlabels = {
- 'year_from': 'Start Year',
- 'year_to': 'End Year',
- 'tag': 'Confidence Level',
- "is_disputed" : " Dispute? ",
- "is_uncertain" : " Uncertainty? ",
+from seshat.apps.general.forms import commonlabels, commonfields, commonwidgets, ExpertReviewedForm
+from seshat.apps.accounts.models import Seshat_Expert
- "expert_reviewed" : " Expert Checked?",
- "drb_reviewed" : " Data Review Board Reviewed?",
- 'citations': 'Add one or more Citations',
- 'finalized': 'This piece of data is verified.',
-}
+# commonlabels = {
+# 'year_from': 'Start Year',
+# 'year_to': 'End Year',
+# 'tag': 'Confidence Level',
+# "is_disputed" : " Dispute? ",
+# "is_uncertain" : " Uncertainty? ",
-commonfields = ['polity', 'year_from', 'year_to',
- 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
+# "expert_reviewed" : " Expert Checked?",
+# "drb_reviewed" : " Data Review Board Reviewed?",
+# 'citations': 'Add one or more Citations',
+# 'finalized': 'This piece of data is verified.',
+# }
-commonwidgets = {
- 'polity': forms.Select(attrs={'class': 'form-control mb-1 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}), 'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
- 'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
- 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 140px', 'placeholder':'Add a meaningful description (optional)'}),
- 'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
- 'tag': forms.RadioSelect(),
- "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- "drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
- 'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
-}
+# commonfields = ['polity', 'year_from', 'year_to',
+# 'description', 'tag', 'is_disputed', 'is_uncertain', 'expert_reviewed', 'drb_reviewed', 'finalized', 'citations']
-class Long_wallForm(forms.ModelForm):
+# commonwidgets = {
+# 'polity': forms.Select(attrs={'class': 'form-control mb-1 js-example-basic-single', 'id': 'id_polity', 'name': 'polity'}), 'year_from': forms.NumberInput(attrs={'class': 'form-control mb-3',}),
+# 'year_to': forms.NumberInput(attrs={'class': 'form-control mb-3', }),
+# 'description': Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 140px', 'placeholder':'Add a meaningful description (optional)'}),
+# 'citations': forms.SelectMultiple(attrs={'class': 'form-control mb-3 js-states js-example-basic-multiple', 'text':'citations[]' , 'style': 'height: 340px', 'multiple': 'multiple'}),
+# 'tag': forms.RadioSelect(),
+# "is_disputed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "is_uncertain" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "expert_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# "drb_reviewed" : forms.CheckboxInput(attrs={'class': 'mb-3', }),
+# 'finalized': forms.CheckboxInput(attrs={'class': 'mb-3', 'checked': True, }),
+# }
+
+class Long_wallForm(ExpertReviewedForm):
"""
"""
@@ -60,7 +63,7 @@ class Meta:
widgets['long_wall_to'] = forms.NumberInput(attrs={'class': 'form-control mb-3', })
-class CopperForm(forms.ModelForm):
+class CopperForm(ExpertReviewedForm):
"""
"""
@@ -77,7 +80,7 @@ class Meta:
widgets['copper'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class BronzeForm(forms.ModelForm):
+class BronzeForm(ExpertReviewedForm):
"""
"""
@@ -94,7 +97,7 @@ class Meta:
widgets['bronze'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class IronForm(forms.ModelForm):
+class IronForm(ExpertReviewedForm):
"""
"""
@@ -111,7 +114,7 @@ class Meta:
widgets['iron'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class SteelForm(forms.ModelForm):
+class SteelForm(ExpertReviewedForm):
"""
"""
@@ -128,7 +131,7 @@ class Meta:
widgets['steel'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class JavelinForm(forms.ModelForm):
+class JavelinForm(ExpertReviewedForm):
"""
"""
@@ -145,7 +148,7 @@ class Meta:
widgets['javelin'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class AtlatlForm(forms.ModelForm):
+class AtlatlForm(ExpertReviewedForm):
"""
"""
@@ -162,7 +165,7 @@ class Meta:
widgets['atlatl'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class SlingForm(forms.ModelForm):
+class SlingForm(ExpertReviewedForm):
"""
"""
@@ -179,7 +182,7 @@ class Meta:
widgets['sling'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Self_bowForm(forms.ModelForm):
+class Self_bowForm(ExpertReviewedForm):
"""
"""
@@ -196,7 +199,7 @@ class Meta:
widgets['self_bow'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Composite_bowForm(forms.ModelForm):
+class Composite_bowForm(ExpertReviewedForm):
"""
"""
@@ -213,7 +216,7 @@ class Meta:
widgets['composite_bow'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class CrossbowForm(forms.ModelForm):
+class CrossbowForm(ExpertReviewedForm):
"""
"""
@@ -230,7 +233,7 @@ class Meta:
widgets['crossbow'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Tension_siege_engineForm(forms.ModelForm):
+class Tension_siege_engineForm(ExpertReviewedForm):
"""
"""
@@ -247,7 +250,7 @@ class Meta:
widgets['tension_siege_engine'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Sling_siege_engineForm(forms.ModelForm):
+class Sling_siege_engineForm(ExpertReviewedForm):
"""
"""
@@ -264,7 +267,7 @@ class Meta:
widgets['sling_siege_engine'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Gunpowder_siege_artilleryForm(forms.ModelForm):
+class Gunpowder_siege_artilleryForm(ExpertReviewedForm):
"""
"""
@@ -281,7 +284,7 @@ class Meta:
widgets['gunpowder_siege_artillery'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Handheld_firearmForm(forms.ModelForm):
+class Handheld_firearmForm(ExpertReviewedForm):
"""
"""
@@ -298,7 +301,7 @@ class Meta:
widgets['handheld_firearm'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class War_clubForm(forms.ModelForm):
+class War_clubForm(ExpertReviewedForm):
"""
"""
@@ -315,7 +318,7 @@ class Meta:
widgets['war_club'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Battle_axeForm(forms.ModelForm):
+class Battle_axeForm(ExpertReviewedForm):
"""
"""
@@ -332,7 +335,7 @@ class Meta:
widgets['battle_axe'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class DaggerForm(forms.ModelForm):
+class DaggerForm(ExpertReviewedForm):
"""
"""
@@ -349,7 +352,7 @@ class Meta:
widgets['dagger'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class SwordForm(forms.ModelForm):
+class SwordForm(ExpertReviewedForm):
"""
"""
@@ -366,7 +369,7 @@ class Meta:
widgets['sword'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class SpearForm(forms.ModelForm):
+class SpearForm(ExpertReviewedForm):
"""
"""
@@ -383,7 +386,7 @@ class Meta:
widgets['spear'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class PolearmForm(forms.ModelForm):
+class PolearmForm(ExpertReviewedForm):
"""
"""
@@ -400,7 +403,7 @@ class Meta:
widgets['polearm'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class DogForm(forms.ModelForm):
+class DogForm(ExpertReviewedForm):
"""
"""
@@ -417,7 +420,7 @@ class Meta:
widgets['dog'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class DonkeyForm(forms.ModelForm):
+class DonkeyForm(ExpertReviewedForm):
"""
"""
@@ -434,7 +437,7 @@ class Meta:
widgets['donkey'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class HorseForm(forms.ModelForm):
+class HorseForm(ExpertReviewedForm):
"""
"""
@@ -451,7 +454,7 @@ class Meta:
widgets['horse'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class CamelForm(forms.ModelForm):
+class CamelForm(ExpertReviewedForm):
"""
"""
@@ -468,7 +471,7 @@ class Meta:
widgets['camel'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class ElephantForm(forms.ModelForm):
+class ElephantForm(ExpertReviewedForm):
"""
"""
@@ -485,7 +488,7 @@ class Meta:
widgets['elephant'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Wood_bark_etcForm(forms.ModelForm):
+class Wood_bark_etcForm(ExpertReviewedForm):
"""
"""
@@ -502,7 +505,7 @@ class Meta:
widgets['wood_bark_etc'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Leather_clothForm(forms.ModelForm):
+class Leather_clothForm(ExpertReviewedForm):
"""
"""
@@ -519,7 +522,7 @@ class Meta:
widgets['leather_cloth'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class ShieldForm(forms.ModelForm):
+class ShieldForm(ExpertReviewedForm):
"""
"""
@@ -536,7 +539,7 @@ class Meta:
widgets['shield'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class HelmetForm(forms.ModelForm):
+class HelmetForm(ExpertReviewedForm):
"""
"""
@@ -553,7 +556,7 @@ class Meta:
widgets['helmet'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class BreastplateForm(forms.ModelForm):
+class BreastplateForm(ExpertReviewedForm):
"""
"""
@@ -570,7 +573,7 @@ class Meta:
widgets['breastplate'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Limb_protectionForm(forms.ModelForm):
+class Limb_protectionForm(ExpertReviewedForm):
"""
"""
@@ -587,7 +590,7 @@ class Meta:
widgets['limb_protection'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Scaled_armorForm(forms.ModelForm):
+class Scaled_armorForm(ExpertReviewedForm):
"""
"""
@@ -604,7 +607,7 @@ class Meta:
widgets['scaled_armor'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Laminar_armorForm(forms.ModelForm):
+class Laminar_armorForm(ExpertReviewedForm):
"""
"""
@@ -621,7 +624,7 @@ class Meta:
widgets['laminar_armor'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Plate_armorForm(forms.ModelForm):
+class Plate_armorForm(ExpertReviewedForm):
"""
"""
@@ -638,7 +641,7 @@ class Meta:
widgets['plate_armor'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Small_vessels_canoes_etcForm(forms.ModelForm):
+class Small_vessels_canoes_etcForm(ExpertReviewedForm):
"""
"""
@@ -655,7 +658,7 @@ class Meta:
widgets['small_vessels_canoes_etc'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Merchant_ships_pressed_into_serviceForm(forms.ModelForm):
+class Merchant_ships_pressed_into_serviceForm(ExpertReviewedForm):
"""
"""
@@ -672,7 +675,7 @@ class Meta:
widgets['merchant_ships_pressed_into_service'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Specialized_military_vesselForm(forms.ModelForm):
+class Specialized_military_vesselForm(ExpertReviewedForm):
"""
"""
@@ -689,7 +692,7 @@ class Meta:
widgets['specialized_military_vessel'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Settlements_in_a_defensive_positionForm(forms.ModelForm):
+class Settlements_in_a_defensive_positionForm(ExpertReviewedForm):
"""
"""
@@ -706,7 +709,7 @@ class Meta:
widgets['settlements_in_a_defensive_position'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Wooden_palisadeForm(forms.ModelForm):
+class Wooden_palisadeForm(ExpertReviewedForm):
"""
"""
@@ -723,7 +726,7 @@ class Meta:
widgets['wooden_palisade'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Earth_rampartForm(forms.ModelForm):
+class Earth_rampartForm(ExpertReviewedForm):
"""
"""
@@ -740,7 +743,7 @@ class Meta:
widgets['earth_rampart'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class DitchForm(forms.ModelForm):
+class DitchForm(ExpertReviewedForm):
"""
"""
@@ -757,7 +760,7 @@ class Meta:
widgets['ditch'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class MoatForm(forms.ModelForm):
+class MoatForm(ExpertReviewedForm):
"""
"""
@@ -774,7 +777,7 @@ class Meta:
widgets['moat'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Stone_walls_non_mortaredForm(forms.ModelForm):
+class Stone_walls_non_mortaredForm(ExpertReviewedForm):
"""
"""
@@ -791,7 +794,7 @@ class Meta:
widgets['stone_walls_non_mortared'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Stone_walls_mortaredForm(forms.ModelForm):
+class Stone_walls_mortaredForm(ExpertReviewedForm):
"""
"""
@@ -808,7 +811,7 @@ class Meta:
widgets['stone_walls_mortared'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Fortified_campForm(forms.ModelForm):
+class Fortified_campForm(ExpertReviewedForm):
"""
"""
@@ -825,7 +828,7 @@ class Meta:
widgets['fortified_camp'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Complex_fortificationForm(forms.ModelForm):
+class Complex_fortificationForm(ExpertReviewedForm):
"""
"""
@@ -842,7 +845,7 @@ class Meta:
widgets['complex_fortification'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class Modern_fortificationForm(forms.ModelForm):
+class Modern_fortificationForm(ExpertReviewedForm):
"""
"""
@@ -859,7 +862,7 @@ class Meta:
widgets['modern_fortification'] = forms.Select(attrs={'class': 'form-control mb-3', })
-class ChainmailForm(forms.ModelForm):
+class ChainmailForm(ExpertReviewedForm):
"""
"""
diff --git a/seshat/apps/wf/migrations/0008_alter_atlatl_comment_alter_battle_axe_comment_and_more.py b/seshat/apps/wf/migrations/0008_alter_atlatl_comment_alter_battle_axe_comment_and_more.py
new file mode 100644
index 000000000..96c7edc64
--- /dev/null
+++ b/seshat/apps/wf/migrations/0008_alter_atlatl_comment_alter_battle_axe_comment_and_more.py
@@ -0,0 +1,260 @@
+# Generated by Django 4.0.3 on 2024-12-06 18:51
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('core', '0068_rename_videoshapefile_cliopatria'),
+ ('wf', '0007_alter_atlatl_atlatl_alter_battle_axe_battle_axe_and_more'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='atlatl',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='battle_axe',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='breastplate',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='bronze',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='camel',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='chainmail',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='complex_fortification',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='composite_bow',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='copper',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='crossbow',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='dagger',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='ditch',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='dog',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='donkey',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='earth_rampart',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='elephant',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='fortified_camp',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='gunpowder_siege_artillery',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='handheld_firearm',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='helmet',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='horse',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='iron',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='javelin',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='laminar_armor',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='leather_cloth',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='limb_protection',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='long_wall',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='merchant_ships_pressed_into_service',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='moat',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='modern_fortification',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='plate_armor',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='polearm',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='scaled_armor',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='self_bow',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='settlements_in_a_defensive_position',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='shield',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='sling',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='sling_siege_engine',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='small_vessels_canoes_etc',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='spear',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='specialized_military_vessel',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='steel',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='stone_walls_mortared',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='stone_walls_non_mortared',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='sword',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='tension_siege_engine',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='war_club',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='wood_bark_etc',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ migrations.AlterField(
+ model_name='wooden_palisade',
+ name='comment',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_related', related_query_name='%(app_label)s_%(class)s', to='core.seshatcomment'),
+ ),
+ ]
diff --git a/seshat/apps/wf/templates/wf/atlatl/atlatl_list_all.html b/seshat/apps/wf/templates/wf/atlatl/atlatl_list_all.html
index df6f36e2c..d42077187 100644
--- a/seshat/apps/wf/templates/wf/atlatl/atlatl_list_all.html
+++ b/seshat/apps/wf/templates/wf/atlatl/atlatl_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/battle_axe/battle_axe_list_all.html b/seshat/apps/wf/templates/wf/battle_axe/battle_axe_list_all.html
index 6255b4d23..69fad9c28 100644
--- a/seshat/apps/wf/templates/wf/battle_axe/battle_axe_list_all.html
+++ b/seshat/apps/wf/templates/wf/battle_axe/battle_axe_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/breastplate/breastplate_list_all.html b/seshat/apps/wf/templates/wf/breastplate/breastplate_list_all.html
index 93a696ac5..51d8beb75 100644
--- a/seshat/apps/wf/templates/wf/breastplate/breastplate_list_all.html
+++ b/seshat/apps/wf/templates/wf/breastplate/breastplate_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/bronze/bronze_list_all.html b/seshat/apps/wf/templates/wf/bronze/bronze_list_all.html
index 479289b4d..11d3ca810 100644
--- a/seshat/apps/wf/templates/wf/bronze/bronze_list_all.html
+++ b/seshat/apps/wf/templates/wf/bronze/bronze_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/camel/camel_list_all.html b/seshat/apps/wf/templates/wf/camel/camel_list_all.html
index 9e76c3185..19abb92d2 100644
--- a/seshat/apps/wf/templates/wf/camel/camel_list_all.html
+++ b/seshat/apps/wf/templates/wf/camel/camel_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/chainmail/chainmail_list_all.html b/seshat/apps/wf/templates/wf/chainmail/chainmail_list_all.html
index e05977f0a..8c93a4f58 100644
--- a/seshat/apps/wf/templates/wf/chainmail/chainmail_list_all.html
+++ b/seshat/apps/wf/templates/wf/chainmail/chainmail_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/complex_fortification/complex_fortification_list_all.html b/seshat/apps/wf/templates/wf/complex_fortification/complex_fortification_list_all.html
index e7c91760c..cd4c3ecaa 100644
--- a/seshat/apps/wf/templates/wf/complex_fortification/complex_fortification_list_all.html
+++ b/seshat/apps/wf/templates/wf/complex_fortification/complex_fortification_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/composite_bow/composite_bow_list_all.html b/seshat/apps/wf/templates/wf/composite_bow/composite_bow_list_all.html
index 5917a1ec4..352424629 100644
--- a/seshat/apps/wf/templates/wf/composite_bow/composite_bow_list_all.html
+++ b/seshat/apps/wf/templates/wf/composite_bow/composite_bow_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/copper/copper_list_all.html b/seshat/apps/wf/templates/wf/copper/copper_list_all.html
index 10acb74a4..3daa23032 100644
--- a/seshat/apps/wf/templates/wf/copper/copper_list_all.html
+++ b/seshat/apps/wf/templates/wf/copper/copper_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/crossbow/crossbow_list_all.html b/seshat/apps/wf/templates/wf/crossbow/crossbow_list_all.html
index 7e0493c2d..820e2c6a1 100644
--- a/seshat/apps/wf/templates/wf/crossbow/crossbow_list_all.html
+++ b/seshat/apps/wf/templates/wf/crossbow/crossbow_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/dagger/dagger_list_all.html b/seshat/apps/wf/templates/wf/dagger/dagger_list_all.html
index 787a15124..68a02aae4 100644
--- a/seshat/apps/wf/templates/wf/dagger/dagger_list_all.html
+++ b/seshat/apps/wf/templates/wf/dagger/dagger_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/ditch/ditch_list_all.html b/seshat/apps/wf/templates/wf/ditch/ditch_list_all.html
index a00c4ca1a..6fd16ea3b 100644
--- a/seshat/apps/wf/templates/wf/ditch/ditch_list_all.html
+++ b/seshat/apps/wf/templates/wf/ditch/ditch_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/dog/dog_list_all.html b/seshat/apps/wf/templates/wf/dog/dog_list_all.html
index 499f13ba9..f9ff120fe 100644
--- a/seshat/apps/wf/templates/wf/dog/dog_list_all.html
+++ b/seshat/apps/wf/templates/wf/dog/dog_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/donkey/donkey_list_all.html b/seshat/apps/wf/templates/wf/donkey/donkey_list_all.html
index 3bf144e1f..c698297cb 100644
--- a/seshat/apps/wf/templates/wf/donkey/donkey_list_all.html
+++ b/seshat/apps/wf/templates/wf/donkey/donkey_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/earth_rampart/earth_rampart_list_all.html b/seshat/apps/wf/templates/wf/earth_rampart/earth_rampart_list_all.html
index 2fb67129a..1ad666b3c 100644
--- a/seshat/apps/wf/templates/wf/earth_rampart/earth_rampart_list_all.html
+++ b/seshat/apps/wf/templates/wf/earth_rampart/earth_rampart_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/elephant/elephant_list_all.html b/seshat/apps/wf/templates/wf/elephant/elephant_list_all.html
index 48c5ed7a0..e3dc0703e 100644
--- a/seshat/apps/wf/templates/wf/elephant/elephant_list_all.html
+++ b/seshat/apps/wf/templates/wf/elephant/elephant_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/fortified_camp/fortified_camp_list_all.html b/seshat/apps/wf/templates/wf/fortified_camp/fortified_camp_list_all.html
index afa5f1f91..af3a5ec8c 100644
--- a/seshat/apps/wf/templates/wf/fortified_camp/fortified_camp_list_all.html
+++ b/seshat/apps/wf/templates/wf/fortified_camp/fortified_camp_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/gunpowder_siege_artillery/gunpowder_siege_artillery_list_all.html b/seshat/apps/wf/templates/wf/gunpowder_siege_artillery/gunpowder_siege_artillery_list_all.html
index 97dedd6da..b2a52518a 100644
--- a/seshat/apps/wf/templates/wf/gunpowder_siege_artillery/gunpowder_siege_artillery_list_all.html
+++ b/seshat/apps/wf/templates/wf/gunpowder_siege_artillery/gunpowder_siege_artillery_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/handheld_firearm/handheld_firearm_list_all.html b/seshat/apps/wf/templates/wf/handheld_firearm/handheld_firearm_list_all.html
index cfb354f3e..f118270e0 100644
--- a/seshat/apps/wf/templates/wf/handheld_firearm/handheld_firearm_list_all.html
+++ b/seshat/apps/wf/templates/wf/handheld_firearm/handheld_firearm_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/helmet/helmet_list_all.html b/seshat/apps/wf/templates/wf/helmet/helmet_list_all.html
index 8ab117084..23809b37e 100644
--- a/seshat/apps/wf/templates/wf/helmet/helmet_list_all.html
+++ b/seshat/apps/wf/templates/wf/helmet/helmet_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/horse/horse_list_all.html b/seshat/apps/wf/templates/wf/horse/horse_list_all.html
index 1816a1304..23de721a5 100644
--- a/seshat/apps/wf/templates/wf/horse/horse_list_all.html
+++ b/seshat/apps/wf/templates/wf/horse/horse_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/iron/iron_list_all.html b/seshat/apps/wf/templates/wf/iron/iron_list_all.html
index 440c6244f..f60666d1f 100644
--- a/seshat/apps/wf/templates/wf/iron/iron_list_all.html
+++ b/seshat/apps/wf/templates/wf/iron/iron_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/javelin/javelin_list_all.html b/seshat/apps/wf/templates/wf/javelin/javelin_list_all.html
index 76247c57a..9ded520f5 100644
--- a/seshat/apps/wf/templates/wf/javelin/javelin_list_all.html
+++ b/seshat/apps/wf/templates/wf/javelin/javelin_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/laminar_armor/laminar_armor_list_all.html b/seshat/apps/wf/templates/wf/laminar_armor/laminar_armor_list_all.html
index 81841913f..161c9cce3 100644
--- a/seshat/apps/wf/templates/wf/laminar_armor/laminar_armor_list_all.html
+++ b/seshat/apps/wf/templates/wf/laminar_armor/laminar_armor_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/leather_cloth/leather_cloth_list_all.html b/seshat/apps/wf/templates/wf/leather_cloth/leather_cloth_list_all.html
index 15c4d77da..5b1293efd 100644
--- a/seshat/apps/wf/templates/wf/leather_cloth/leather_cloth_list_all.html
+++ b/seshat/apps/wf/templates/wf/leather_cloth/leather_cloth_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/limb_protection/limb_protection_list_all.html b/seshat/apps/wf/templates/wf/limb_protection/limb_protection_list_all.html
index 7d7a8be5c..d802dec17 100644
--- a/seshat/apps/wf/templates/wf/limb_protection/limb_protection_list_all.html
+++ b/seshat/apps/wf/templates/wf/limb_protection/limb_protection_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/merchant_ships_pressed_into_service/merchant_ships_pressed_into_service_list_all.html b/seshat/apps/wf/templates/wf/merchant_ships_pressed_into_service/merchant_ships_pressed_into_service_list_all.html
index 21d72872b..ebde79a20 100644
--- a/seshat/apps/wf/templates/wf/merchant_ships_pressed_into_service/merchant_ships_pressed_into_service_list_all.html
+++ b/seshat/apps/wf/templates/wf/merchant_ships_pressed_into_service/merchant_ships_pressed_into_service_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/moat/moat_list_all.html b/seshat/apps/wf/templates/wf/moat/moat_list_all.html
index f883e50c7..60a4f2274 100644
--- a/seshat/apps/wf/templates/wf/moat/moat_list_all.html
+++ b/seshat/apps/wf/templates/wf/moat/moat_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/modern_fortification/modern_fortification_list_all.html b/seshat/apps/wf/templates/wf/modern_fortification/modern_fortification_list_all.html
index 9256c1d68..3f1b5db40 100644
--- a/seshat/apps/wf/templates/wf/modern_fortification/modern_fortification_list_all.html
+++ b/seshat/apps/wf/templates/wf/modern_fortification/modern_fortification_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/plate_armor/plate_armor_list_all.html b/seshat/apps/wf/templates/wf/plate_armor/plate_armor_list_all.html
index 8857cbf17..30e4aff87 100644
--- a/seshat/apps/wf/templates/wf/plate_armor/plate_armor_list_all.html
+++ b/seshat/apps/wf/templates/wf/plate_armor/plate_armor_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/polearm/polearm_list_all.html b/seshat/apps/wf/templates/wf/polearm/polearm_list_all.html
index 8a323932e..ad05bdeb0 100644
--- a/seshat/apps/wf/templates/wf/polearm/polearm_list_all.html
+++ b/seshat/apps/wf/templates/wf/polearm/polearm_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/scaled_armor/scaled_armor_list_all.html b/seshat/apps/wf/templates/wf/scaled_armor/scaled_armor_list_all.html
index ae6924d35..be6fcf8dc 100644
--- a/seshat/apps/wf/templates/wf/scaled_armor/scaled_armor_list_all.html
+++ b/seshat/apps/wf/templates/wf/scaled_armor/scaled_armor_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/self_bow/self_bow_list_all.html b/seshat/apps/wf/templates/wf/self_bow/self_bow_list_all.html
index 077917963..4afe301c3 100644
--- a/seshat/apps/wf/templates/wf/self_bow/self_bow_list_all.html
+++ b/seshat/apps/wf/templates/wf/self_bow/self_bow_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/settlements_in_a_defensive_position/settlements_in_a_defensive_position_list_all.html b/seshat/apps/wf/templates/wf/settlements_in_a_defensive_position/settlements_in_a_defensive_position_list_all.html
index 8e4266eb9..0d5888bb4 100644
--- a/seshat/apps/wf/templates/wf/settlements_in_a_defensive_position/settlements_in_a_defensive_position_list_all.html
+++ b/seshat/apps/wf/templates/wf/settlements_in_a_defensive_position/settlements_in_a_defensive_position_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/shield/shield_list_all.html b/seshat/apps/wf/templates/wf/shield/shield_list_all.html
index 39ee715ec..452672c32 100644
--- a/seshat/apps/wf/templates/wf/shield/shield_list_all.html
+++ b/seshat/apps/wf/templates/wf/shield/shield_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/sling/sling_list_all.html b/seshat/apps/wf/templates/wf/sling/sling_list_all.html
index bb57a66f5..2d496a976 100644
--- a/seshat/apps/wf/templates/wf/sling/sling_list_all.html
+++ b/seshat/apps/wf/templates/wf/sling/sling_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/sling_siege_engine/sling_siege_engine_list_all.html b/seshat/apps/wf/templates/wf/sling_siege_engine/sling_siege_engine_list_all.html
index 9513a64fe..62b99f65f 100644
--- a/seshat/apps/wf/templates/wf/sling_siege_engine/sling_siege_engine_list_all.html
+++ b/seshat/apps/wf/templates/wf/sling_siege_engine/sling_siege_engine_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/small_vessels_canoes_etc/small_vessels_canoes_etc_list_all.html b/seshat/apps/wf/templates/wf/small_vessels_canoes_etc/small_vessels_canoes_etc_list_all.html
index 625461865..8c8ef234c 100644
--- a/seshat/apps/wf/templates/wf/small_vessels_canoes_etc/small_vessels_canoes_etc_list_all.html
+++ b/seshat/apps/wf/templates/wf/small_vessels_canoes_etc/small_vessels_canoes_etc_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/spear/spear_list_all.html b/seshat/apps/wf/templates/wf/spear/spear_list_all.html
index 1b6ee79fe..5f0c6f88c 100644
--- a/seshat/apps/wf/templates/wf/spear/spear_list_all.html
+++ b/seshat/apps/wf/templates/wf/spear/spear_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/specialized_military_vessel/specialized_military_vessel_list_all.html b/seshat/apps/wf/templates/wf/specialized_military_vessel/specialized_military_vessel_list_all.html
index db525cf42..41b2b803b 100644
--- a/seshat/apps/wf/templates/wf/specialized_military_vessel/specialized_military_vessel_list_all.html
+++ b/seshat/apps/wf/templates/wf/specialized_military_vessel/specialized_military_vessel_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/steel/steel_list_all.html b/seshat/apps/wf/templates/wf/steel/steel_list_all.html
index 3fd938917..71762d91e 100644
--- a/seshat/apps/wf/templates/wf/steel/steel_list_all.html
+++ b/seshat/apps/wf/templates/wf/steel/steel_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/stone_walls_mortared/stone_walls_mortared_list_all.html b/seshat/apps/wf/templates/wf/stone_walls_mortared/stone_walls_mortared_list_all.html
index d154e6900..331ce35cb 100644
--- a/seshat/apps/wf/templates/wf/stone_walls_mortared/stone_walls_mortared_list_all.html
+++ b/seshat/apps/wf/templates/wf/stone_walls_mortared/stone_walls_mortared_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/stone_walls_non_mortared/stone_walls_non_mortared_list_all.html b/seshat/apps/wf/templates/wf/stone_walls_non_mortared/stone_walls_non_mortared_list_all.html
index 304c50359..f31cd2409 100644
--- a/seshat/apps/wf/templates/wf/stone_walls_non_mortared/stone_walls_non_mortared_list_all.html
+++ b/seshat/apps/wf/templates/wf/stone_walls_non_mortared/stone_walls_non_mortared_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/sword/sword_list_all.html b/seshat/apps/wf/templates/wf/sword/sword_list_all.html
index d8ab223c6..f9462ddc6 100644
--- a/seshat/apps/wf/templates/wf/sword/sword_list_all.html
+++ b/seshat/apps/wf/templates/wf/sword/sword_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/tension_siege_engine/tension_siege_engine_list_all.html b/seshat/apps/wf/templates/wf/tension_siege_engine/tension_siege_engine_list_all.html
index 461ae02e6..5c2136fbd 100644
--- a/seshat/apps/wf/templates/wf/tension_siege_engine/tension_siege_engine_list_all.html
+++ b/seshat/apps/wf/templates/wf/tension_siege_engine/tension_siege_engine_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/war_club/war_club_list_all.html b/seshat/apps/wf/templates/wf/war_club/war_club_list_all.html
index ed8136395..c4915b838 100644
--- a/seshat/apps/wf/templates/wf/war_club/war_club_list_all.html
+++ b/seshat/apps/wf/templates/wf/war_club/war_club_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/wood_bark_etc/wood_bark_etc_list_all.html b/seshat/apps/wf/templates/wf/wood_bark_etc/wood_bark_etc_list_all.html
index ca9b6a397..de5c31889 100644
--- a/seshat/apps/wf/templates/wf/wood_bark_etc/wood_bark_etc_list_all.html
+++ b/seshat/apps/wf/templates/wf/wood_bark_etc/wood_bark_etc_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/templates/wf/wooden_palisade/wooden_palisade_list_all.html b/seshat/apps/wf/templates/wf/wooden_palisade/wooden_palisade_list_all.html
index 633c17ba3..8c3fe0917 100644
--- a/seshat/apps/wf/templates/wf/wooden_palisade/wooden_palisade_list_all.html
+++ b/seshat/apps/wf/templates/wf/wooden_palisade/wooden_palisade_list_all.html
@@ -73,7 +73,7 @@
Expert
-
+
diff --git a/seshat/apps/wf/urls.py b/seshat/apps/wf/urls.py
index b872d5c87..039a4a46e 100644
--- a/seshat/apps/wf/urls.py
+++ b/seshat/apps/wf/urls.py
@@ -3,6 +3,9 @@
from .forms import Long_wallForm, CopperForm, BronzeForm, IronForm, SteelForm, JavelinForm, AtlatlForm, SlingForm, Self_bowForm, Composite_bowForm, CrossbowForm, Tension_siege_engineForm, Sling_siege_engineForm, Gunpowder_siege_artilleryForm, Handheld_firearmForm, War_clubForm, Battle_axeForm, DaggerForm, SwordForm, SpearForm, PolearmForm, DogForm, DonkeyForm, HorseForm, CamelForm, ElephantForm, Wood_bark_etcForm, Leather_clothForm, ShieldForm, HelmetForm, BreastplateForm, Limb_protectionForm, Scaled_armorForm, Laminar_armorForm, Plate_armorForm, Small_vessels_canoes_etcForm, Merchant_ships_pressed_into_serviceForm, Specialized_military_vesselForm, Settlements_in_a_defensive_positionForm, Wooden_palisadeForm, Earth_rampartForm, DitchForm, MoatForm, Stone_walls_non_mortaredForm, Stone_walls_mortaredForm, Fortified_campForm, Complex_fortificationForm, Modern_fortificationForm, ChainmailForm
+
+from seshat.apps.general.views import dynamic_create_view, dynamic_update_view, dynamic_update_view_old, generic_list_view, generic_download, generic_metadata_download, dynamic_detail_view, confirm_delete_view, delete_object_view
+
from django.urls import path
from .var_defs import wf_var_defs
@@ -1063,24 +1066,28 @@
(Chainmail, ChainmailForm, 'chainmail', 'Chainmail', 'Armor', None),
]
+model_form_pairs_qugmented = [[a[0], a[1], a[2], a[2], a[3], a[4], a[5], 'wf'] for a in model_form_pairs]
+
# Create URL patterns dynamically for each model-class pair: UPDATE
-for model_class, form_class, x_name, myvar, sec, subsec in model_form_pairs:
+for model_class, form_class, x_name, coded_value, myvar, sec, subsec, db_section in model_form_pairs_qugmented:
urlpatterns.append(
- path(f'{x_name}/create/', views.dynamic_create_view, {
+ path(f'{x_name}/create/', dynamic_create_view, {
'form_class': form_class,
'x_name': x_name,
- 'myvar': myvar,
+ 'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': wf_var_defs.get(x_name, f"NO Desc: {x_name}"),
'var_section': sec,
'var_subsection': subsec,
}, name=f'{x_name}-create')
)
urlpatterns.append(
- path(f'{x_name}/updatenew//', views.dynamic_update_view, {
+ path(f'{x_name}/updatenew//', dynamic_update_view, {
'form_class': form_class,
'model_class': model_class,
'x_name': x_name,
- 'myvar': myvar,
+ 'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': wf_var_defs.get(x_name, f"NO Desc: {x_name}"),
'var_section': sec,
'var_subsection': subsec,
@@ -1088,11 +1095,12 @@
}, name=f'{x_name}-updatenew')
)
urlpatterns.append(
- path(f'{x_name}/update_old//', views.dynamic_update_view_old, {
+ path(f'{x_name}/update_old//', dynamic_update_view_old, {
'form_class': form_class,
'model_class': model_class,
'x_name': x_name,
- 'myvar': myvar,
+ 'myvar': myvar,
+ 'coded_value': coded_value,
'my_exp': wf_var_defs.get(x_name, f"NO Desc: {x_name}"),
'var_section': sec,
'var_subsection': subsec,
@@ -1100,18 +1108,20 @@
}, name=f'{x_name}-update')
)
urlpatterns.append(
- path(f'{x_name}//', views.dynamic_detail_view, {
+ path(f'{x_name}//', dynamic_detail_view, {
'model_class': model_class,
'myvar': x_name,
'var_section': sec,
'var_subsection': subsec,
+ 'db_section': db_section,
'var_name_display': myvar,
}, name=f'{x_name}-detail')
)
urlpatterns.append(
- path(f'{x_name}s_all/', views.generic_list_view, {
+ path(f'{x_name}s_all/', generic_list_view, {
'model_class': model_class,
'var_name': x_name,
+ 'coded_value': coded_value,
'var_name_display': myvar,
'var_section': sec,
'var_subsection': subsec,
@@ -1120,25 +1130,25 @@
}, name=f'{x_name}s_all')
)
urlpatterns.append(
- path(f'{x_name}//confirm-delete/', views.confirm_delete_view, {
+ path(f'{x_name}//confirm-delete/', confirm_delete_view, {
'model_class': model_class,
'var_name': x_name,
}, name=f'{x_name}-confirm-delete')
)
urlpatterns.append(
- path(f'{x_name}//delete/', views.delete_object_view, {
+ path(f'{x_name}//delete/', delete_object_view, {
'model_class': model_class,
'var_name': x_name,
}, name=f'{x_name}-delete')
)
urlpatterns.append(
- path(f'{x_name}download/', views.generic_download, {
+ path(f'{x_name}download/', generic_download, {
'model_class': model_class,
'var_name': x_name,
}, name=f'{x_name}-download')
)
urlpatterns.append(
- path(f'{x_name}metadownload/', views.generic_metadata_download, {
+ path(f'{x_name}metadownload/', generic_metadata_download, {
'var_name': x_name,
'var_name_display': myvar,
'var_section': sec,
diff --git a/seshat/urls.py b/seshat/urls.py
index cf44b942c..6e930def0 100644
--- a/seshat/urls.py
+++ b/seshat/urls.py
@@ -8,6 +8,7 @@
from django.conf import settings
from django.conf.urls.static import static
+
#try:
urlpatterns = [
path('admin/', admin.site.urls),
Notes and Citations - +
Notes and Citations
Notes and Citations - +
Notes and Citations
Notes and Citations - +
Notes and Citations
Notes and Citations - +