Intervention model refactoring

* splits Intervention model into three main components
   * Intervention (main object)
   * LegalData (holds legal dates, laws, etc.)
   * ResponsibilityData (holds organizations and handler)
   * This way data can be extended more easily in the future
* refactors admin.py and usages in templates
* introduces UuidModel as a base class for BaseResource
This commit is contained in:
mipel
2021-07-30 09:30:33 +02:00
parent 9f3b858f9f
commit 8cb4e1168d
5 changed files with 90 additions and 32 deletions

View File

@@ -64,31 +64,31 @@
</tr>
<tr>
<th scope="row">{% trans 'Process type' %}</th>
<td class="align-middle">{{intervention.process_type|default_if_none:""}}</td>
<td class="align-middle">{{intervention.legal.process_type|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Law' %}</th>
<td class="align-middle">{{intervention.law|default_if_none:""}}</td>
<td class="align-middle">{{intervention.legal.law|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Registration office' %}</th>
<td class="align-middle">{{intervention.registration_office|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.registration_office|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Registration office file number' %}</th>
<td class="align-middle">{{intervention.registration_file_number|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.registration_file_number|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Conservation office' %}</th>
<td class="align-middle">{{intervention.conservation_office|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.conservation_office|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Conversation office file number' %}</th>
<td class="align-middle">{{intervention.conservation_file_number|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.conservation_file_number|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Intervention handler' %}</th>
<td class="align-middle">{{intervention.handler|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.handler|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Checked' %}</th>
@@ -98,7 +98,7 @@
{% fa5_icon 'star' 'far' %}
</span>
{% else %}
<span class="check-star">
<span class="check-star" title="{% trans 'Checked on '%} {{intervention.checked.timestamp}} {% trans 'by' %} {{intervention.checked.user}}">
{% fa5_icon 'star' %}
</span>
{% endif %}
@@ -112,7 +112,7 @@
{% fa5_icon 'bookmark' 'far' %}
</span>
{% else %}
<span class="registered-bookmark">
<span class="registered-bookmark" title="{% trans 'Recorded on '%} {{intervention.recorded.timestamp}} {% trans 'by' %} {{intervention.recorded.user}}">
{% fa5_icon 'bookmark' %}
</span>
{% endif %}
@@ -120,11 +120,11 @@
</tr>
<tr>
<th scope="row">{% trans 'Registration date' %}</th>
<td class="align-middle">{{intervention.registration_date|default_if_none:""}}</td>
<td class="align-middle">{{intervention.legal.registration_date|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Binding on' %}</th>
<td class="align-middle">{{intervention.binding_on|default_if_none:""}}</td>
<td class="align-middle">{{intervention.legal.binding_on|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Last modified' %}</th>