mirror of
https://github.com/Superredstone/patrickcanal.it.git
synced 2026-09-20 17:51:12 +02:00
feat(portfolio): add project search
This commit is contained in:
+13
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user