Search now also includes type and description
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 24s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 6s
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 24s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 6s
This commit is contained in:
@@ -27,7 +27,7 @@ spec:
|
|||||||
mountPath: /data
|
mountPath: /data
|
||||||
containers:
|
containers:
|
||||||
- name: web
|
- name: web
|
||||||
image: git.baumann.gr/adebaumann/labhelper:0.040
|
image: git.baumann.gr/adebaumann/labhelper:0.041
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
from django.db.models import Q
|
||||||
from django.http import HttpResponse, JsonResponse
|
from django.http import HttpResponse, JsonResponse
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
|
|
||||||
@@ -74,7 +75,9 @@ def search_api(request):
|
|||||||
return JsonResponse({'results': []})
|
return JsonResponse({'results': []})
|
||||||
|
|
||||||
things = Thing.objects.filter(
|
things = Thing.objects.filter(
|
||||||
name__icontains=query
|
Q(name__icontains=query) |
|
||||||
|
Q(description__icontains=query) |
|
||||||
|
Q(thing_type__name__icontains=query)
|
||||||
).select_related('thing_type', 'box')[:50]
|
).select_related('thing_type', 'box')[:50]
|
||||||
|
|
||||||
results = [
|
results = [
|
||||||
|
|||||||
Reference in New Issue
Block a user