[UPDT] HORILLA VIEWS: List view with optional filter class
This commit is contained in:
@@ -351,7 +351,6 @@ def send_mail(request, automation, instance):
|
|||||||
to = tos[:1]
|
to = tos[:1]
|
||||||
cc = tos[1:]
|
cc = tos[1:]
|
||||||
email_backend = ConfiguredEmailBackend()
|
email_backend = ConfiguredEmailBackend()
|
||||||
print("MAIL SENTTTTT METHODDDDDDDDDD")
|
|
||||||
host = email_backend.dynamic_from_email_with_display_name
|
host = email_backend.dynamic_from_email_with_display_name
|
||||||
if mail_to_instance and request:
|
if mail_to_instance and request:
|
||||||
attachments = []
|
attachments = []
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ class HorillaListView(ListView):
|
|||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
if not self.queryset:
|
if not self.queryset:
|
||||||
queryset = super().get_queryset()
|
self.queryset = super().get_queryset()
|
||||||
|
self._saved_filters = QueryDict("", mutable=True)
|
||||||
if self.filter_class:
|
if self.filter_class:
|
||||||
query_dict = self.request.GET
|
query_dict = self.request.GET
|
||||||
if "filter_applied" in query_dict.keys():
|
if "filter_applied" in query_dict.keys():
|
||||||
@@ -144,7 +144,7 @@ class HorillaListView(ListView):
|
|||||||
self._saved_filters = query_dict
|
self._saved_filters = query_dict
|
||||||
self.request.exclude_filter_form = True
|
self.request.exclude_filter_form = True
|
||||||
self.queryset = self.filter_class(
|
self.queryset = self.filter_class(
|
||||||
data=query_dict, queryset=queryset, request=self.request
|
data=query_dict, queryset=self.queryset, request=self.request
|
||||||
).qs
|
).qs
|
||||||
return self.queryset
|
return self.queryset
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
></ion-icon>
|
></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{% if search_url %}
|
||||||
<form autocomplete="off" id="filterForm" onsubmit="event.preventDefault()" hx-get="{{search_url}}?&referrer={{request.META.HTTP_REFERER}}&{{request.GET.urlencode}}" hx-replace-url="true" hx-target="{{search_swap_target}}" class="oh-main__titlebar oh-main__titlebar--right">
|
<form autocomplete="off" id="filterForm" onsubmit="event.preventDefault()" hx-get="{{search_url}}?&referrer={{request.META.HTTP_REFERER}}&{{request.GET.urlencode}}" hx-replace-url="true" hx-target="{{search_swap_target}}" class="oh-main__titlebar oh-main__titlebar--right">
|
||||||
<div class="oh-input-group oh-input__search-group" id="searchGroup">
|
<div class="oh-input-group oh-input__search-group" id="searchGroup">
|
||||||
<ion-icon
|
<ion-icon
|
||||||
@@ -182,6 +183,8 @@
|
|||||||
<input type="hidden" id="pageInput">
|
<input type="hidden" id="pageInput">
|
||||||
<input type="hidden" id="sortInput">
|
<input type="hidden" id="sortInput">
|
||||||
</form>
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if create_attrs %}
|
{% if create_attrs %}
|
||||||
<a
|
<a
|
||||||
class="oh-btn oh-btn--secondary ml-2"
|
class="oh-btn oh-btn--secondary ml-2"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
{% for object in instances|slice:"6" %}
|
{% for object in instances|slice:"6" %}
|
||||||
<li {% if instance.pk == object.pk %} class="active" {% endif %}>
|
<li {% if instance.pk == object.pk %} class="active" {% endif %}>
|
||||||
<a
|
<a
|
||||||
hx-get="{{object.get_profile_url}}"
|
hx-get="{{object.get_profile_url}}?{{request.GET.urlencode}}"
|
||||||
hx-target="#{{view_id|safe}}"
|
hx-target="#{{view_id|safe}}"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
class="d-block">
|
class="d-block">
|
||||||
|
|||||||
Reference in New Issue
Block a user