Change file name

This commit is contained in:
zandercymatics 2024-04-11 11:16:42 -06:00
parent f37eafdc53
commit 4d043e586f
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
5 changed files with 26 additions and 4 deletions

View file

@ -1,6 +1,7 @@
from datetime import date
import logging
import copy
from django import forms
from django.db.models import Value, CharField, Q
from django.db.models.functions import Concat, Coalesce
@ -1436,9 +1437,16 @@ class DomainInformationInline(admin.StackedInline):
We had issues inheriting from both StackedInline
and the source DomainInformationAdmin since these
classes conflict, so we'll just pull what we need
from DomainInformationAdmin"""
from DomainInformationAdmin
Note that `template` cannot be set through this function,
due to how admin.StackedInline behaves.
See `domain_change_form.html` for more information.
"""
form = DomainInformationInlineForm
model = models.DomainInformation
fieldsets = copy.deepcopy(DomainInformationAdmin.fieldsets)

View file

@ -36,6 +36,7 @@ https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/
{% block fieldset %}
{% include "admin/includes/fieldset.html" %}
{% endblock fieldset%}
{# End of .gov override #}
{% endfor %}
{% if inline_admin_form.needs_explicit_pk_field %}
@ -48,4 +49,4 @@ https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/
{% endfor %}
</fieldset>
</div>
</div>

View file

@ -36,9 +36,23 @@
{{ block.super }}
{% endblock %}
{% comment %}
The custom inline definition MUST be passed in this way.
This is because we can't pass in additional context information from this scope
unless by overriding a bunch of base formset functions.
In this version of Django, inlines are handled much differently on the backend when there isn't a clear
reason as to why. It appears to be that they simply haven't been updated for a while.
Alternatively, we could create a second "duplicate" detail_table_fieldset.html file (or many if statements),
but we lose out on centralizing all this logic inside of one file. The tradeoff here seems to be between
code duplication vs not overriding the default.
As a consequence, this means that we can't override the template on this inline by
passing in template="path/to/file". We get much more control this way.
{% endcomment %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include "django/admin/includes/domain_information_inline_change_form.html" with original_object=original.domain_info%}
{% include "django/admin/includes/domain_info_inline_stacked.html" with original_object=original.domain_info%}
{% endfor %}
{% endblock %}

View file

@ -94,7 +94,6 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
<td class="padding-left-1">{{ contact.title }}</td>
<td class="padding-left-1">
{{ contact.email }}
</td>
<td class="padding-left-1">{{ contact.phone }}</td>
<td class="padding-left-1 text-size-small">