mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
also search url, timestamp, tags on public index
This commit is contained in:
parent
f6c3683ab8
commit
8a4edb45e7
2 changed files with 3 additions and 2 deletions
|
@ -9,6 +9,7 @@ from django.http import HttpResponse
|
|||
from django.views import View, static
|
||||
from django.views.generic.list import ListView
|
||||
from django.views.generic import FormView
|
||||
from django.db.models import Q
|
||||
from django.contrib.auth.mixins import UserPassesTestMixin
|
||||
|
||||
from core.models import Snapshot
|
||||
|
@ -107,7 +108,7 @@ class PublicArchiveView(ListView):
|
|||
qs = super().get_queryset(**kwargs)
|
||||
query = self.request.GET.get('q')
|
||||
if query:
|
||||
qs = qs.filter(title__icontains=query)
|
||||
qs = qs.filter(Q(title__icontains=query) | Q(url__icontains=query) | Q(timestamp__icontains=query) | Q(tags__name__icontains=query))
|
||||
for snapshot in qs:
|
||||
snapshot.icons = snapshot_icons(snapshot)
|
||||
return qs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue