From 8cdee5ebd74933edaef940c4b894737b0ca4ba99 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Thu, 23 Apr 2020 16:44:24 +0200 Subject: [PATCH] Dateien noch in globale Suche aufgenommen --- .../__pycache__/settings.cpython-38.pyc | Bin 3897 -> 3946 bytes digitaleagentur/settings.py | 4 +++- .../templates/standards/standard_area.html | 2 +- users/templates/users/searchres.html | 10 ++++++++++ users/views.py | 7 ++++++- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index d4473921dec2851aea67955f3bb47b1c8a949bd4..7bd64689933c68d56d73fabd3466c70c72ab8d1f 100644 GIT binary patch delta 434 zcmXYuxlRIM6ouy>W^@E*MBEn;_gxWJ6cuH0WpnoyCYXbN1`|xg%EZ_hd!i+UBsSI* z#w*;V<#toRgccIJr0X-TmX%4|LrsiF$i2on{NVi#-%Z0xQ*IgGzR2qzf5B zwWxs=HqmzIFp8?l$bnj_gM*x?qk1?|j|Mbyg&GPk-aCx*R%*lqyqJU!Q<%mKX1PX9 zn4@OQa|tT^Sim9zSmKJwuv}C)qZX`CD}q=RB#5<&hbkU6nMiL#gxV3M4y=<)Z0Q#2 z#0Gh=NnO~YZfsKz?slj*!?N->Ku+#{mvaCgusqd(zNRdYVa+HJnZ7_@yVGxxO}YJnuQbyz;>0X8D6f zStq%82*{^zX5)!m#Gg7lrr69*I*-W3q|X;FH(72q=6!s!h3sSv?Iz-@$<6J^N%_lm VFB{+DEs9;Ubf^kb#wTK8Z~j2j?K9FS-yZh%DN zHXOPHSK*(=dvi{1zQM`K{Y`zP^p>uBBr)~7*PBvXPqL?Wwp`)lMIUKGx{wbl`r#4l zg$BLrvKaZ{qX7IAM1VpFB7`s^CZ{l>?f1f?8K($x$fJM-EMf`ESTR+KVwDE4W=h~# zM-e4#plouBq0;3hqZl@65LMI!sbb6Vy5kLtiS#(OX$U(sj9p5AQ&K2}JsQD2jpBgD za7g1gqT30B-OF!^9OR~yx$b>1uwGGlP+7k7>237f+Ow?vh(B^oRT2tUIxoKOKQkIzrT_o{ diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index b795e99..a8d1148 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -15,9 +15,11 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + ############################################## DEV ##################################### BASE_URL = "https://dev01.digitale-agentur.com/" - +CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True diff --git a/standards/templates/standards/standard_area.html b/standards/templates/standards/standard_area.html index 5f6d58e..3b13821 100644 --- a/standards/templates/standards/standard_area.html +++ b/standards/templates/standards/standard_area.html @@ -9,7 +9,7 @@

Standards aus dem Bereich {{areaname}}


-
+
diff --git a/users/templates/users/searchres.html b/users/templates/users/searchres.html index 24a0f19..f891554 100644 --- a/users/templates/users/searchres.html +++ b/users/templates/users/searchres.html @@ -49,6 +49,16 @@

Keine Ergebnisse bei Mitarbeitern

{% endif %} +
+

Dateien

+ {% if res_files|length > 0 %} + {% for s in res_files %} +   {{s.name}}

+ {% endfor %} + {% else %} +

Keine Ergebnisse bei Mitarbeitern

+ {% endif %} +

Quicklinks

{% if links|length > 0 %} diff --git a/users/views.py b/users/views.py index 61d14df..b7c220f 100644 --- a/users/views.py +++ b/users/views.py @@ -19,6 +19,7 @@ from datetime import datetime from django.utils import timezone from django.utils import formats from news.models import News +from cloud.models import DataFile import requests import json import random @@ -519,7 +520,11 @@ def GlobalSearch(request): res_pers = User.objects.filter(profile__agency__pk=ag).filter(first_name__icontains=searchfor) | User.objects.filter(profile__agency__pk=ag).filter(last_name__icontains=searchfor) links = QuickLinks.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) | QuickLinks.objects.filter(agency__pk=ag).filter(link__icontains=searchfor) - html = render_to_string('users/searchres.html', {'links': links, 'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers, 'res_news' : res_news, 'res_pass' : res_pass, 'res_contacts' : res_contacts}) + res_files = DataFile.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) + + print(res_files) + + html = render_to_string('users/searchres.html', {'links': links, 'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers, 'res_news' : res_news, 'res_pass' : res_pass, 'res_contacts' : res_contacts, 'res_files' : res_files}) return HttpResponse(html) else: return HttpResponse("Request method is not a GET")