feat(portfolio): add project search

This commit is contained in:
2026-09-16 17:45:08 +02:00
parent c2e5f9a3a2
commit f0888c4168
4 changed files with 64 additions and 37 deletions
+13 -2
View File
@@ -18,9 +18,8 @@ class PortfolioView(TemplateView):
}
class ProjectList(ListView):
class ProjectList(TemplateView):
template_name = "project_list.html"
model = models.Project
class ContactSend(TemplateView):
@@ -49,3 +48,15 @@ class CompanyLogo(DetailView):
def get(self, request, *args, **kwargs):
company = self.get_object()
return FileResponse(company.logo)
class ProjectListQuery(ListView):
template_name = "project_list_query.html"
model = models.Project
def get_queryset(self):
query = self.request.GET.get("query")
if not query:
return super().get_queryset()
return super().get_queryset().filter(name__contains=query)