From 19c830ba254fa18994c59e95b4ac4f76a0a91c60 Mon Sep 17 00:00:00 2001 From: Dalahro Date: Sun, 3 Jul 2016 00:27:22 +0200 Subject: [PATCH] Ajout de la fonction de recherche --- logs/__pycache__/__init__.cpython-34.pyc | Bin 0 -> 113 bytes logs/__pycache__/admin.cpython-34.pyc | Bin 0 -> 158 bytes logs/__pycache__/models.cpython-34.pyc | Bin 0 -> 155 bytes logs/__pycache__/views.cpython-34.pyc | Bin 0 -> 295 bytes .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 124 bytes machines/__init__.py | 0 machines/__pycache__/__init__.cpython-34.pyc | Bin 0 -> 117 bytes machines/__pycache__/admin.cpython-34.pyc | Bin 0 -> 696 bytes machines/__pycache__/models.cpython-34.pyc | Bin 0 -> 939 bytes machines/admin.py | 12 +++ machines/migrations/0001_initial.py | 38 ++++++++ machines/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-34.pyc | Bin 0 -> 1161 bytes .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 128 bytes machines/models.py | 16 ++++ machines/tests.py | 3 + machines/views.py | 3 + re2o/__pycache__/__init__.cpython-34.pyc | Bin 0 -> 113 bytes re2o/__pycache__/login.cpython-34.pyc | Bin 0 -> 1124 bytes re2o/__pycache__/urls.cpython-34.pyc | Bin 0 -> 1119 bytes re2o/__pycache__/wsgi.cpython-34.pyc | Bin 0 -> 528 bytes search/__init__.py | 0 search/__pycache__/__init__.cpython-34.pyc | Bin 0 -> 115 bytes search/__pycache__/admin.cpython-34.pyc | Bin 0 -> 160 bytes search/__pycache__/models.cpython-34.pyc | Bin 0 -> 574 bytes search/__pycache__/urls.cpython-34.pyc | Bin 0 -> 263 bytes search/__pycache__/views.cpython-34.pyc | Bin 0 -> 1685 bytes search/admin.py | 3 + search/forms.py | 16 ++++ search/migrations/__init__.py | 0 .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 126 bytes search/models.py | 10 ++ search/templates/search/index.html | 90 ++++++++++++++++++ search/templates/search/search.html | 14 +++ search/templates/search/sidebar.html | 9 ++ search/tests.py | 3 + search/urls.py | 7 ++ search/views.py | 34 +++++++ 38 files changed, 258 insertions(+) create mode 100644 logs/__pycache__/__init__.cpython-34.pyc create mode 100644 logs/__pycache__/admin.cpython-34.pyc create mode 100644 logs/__pycache__/models.cpython-34.pyc create mode 100644 logs/__pycache__/views.cpython-34.pyc create mode 100644 logs/migrations/__pycache__/__init__.cpython-34.pyc create mode 100644 machines/__init__.py create mode 100644 machines/__pycache__/__init__.cpython-34.pyc create mode 100644 machines/__pycache__/admin.cpython-34.pyc create mode 100644 machines/__pycache__/models.cpython-34.pyc create mode 100644 machines/admin.py create mode 100644 machines/migrations/0001_initial.py create mode 100644 machines/migrations/__init__.py create mode 100644 machines/migrations/__pycache__/0001_initial.cpython-34.pyc create mode 100644 machines/migrations/__pycache__/__init__.cpython-34.pyc create mode 100644 machines/models.py create mode 100644 machines/tests.py create mode 100644 machines/views.py create mode 100644 re2o/__pycache__/__init__.cpython-34.pyc create mode 100644 re2o/__pycache__/login.cpython-34.pyc create mode 100644 re2o/__pycache__/urls.cpython-34.pyc create mode 100644 re2o/__pycache__/wsgi.cpython-34.pyc create mode 100644 search/__init__.py create mode 100644 search/__pycache__/__init__.cpython-34.pyc create mode 100644 search/__pycache__/admin.cpython-34.pyc create mode 100644 search/__pycache__/models.cpython-34.pyc create mode 100644 search/__pycache__/urls.cpython-34.pyc create mode 100644 search/__pycache__/views.cpython-34.pyc create mode 100644 search/admin.py create mode 100644 search/forms.py create mode 100644 search/migrations/__init__.py create mode 100644 search/migrations/__pycache__/__init__.cpython-34.pyc create mode 100644 search/models.py create mode 100644 search/templates/search/index.html create mode 100644 search/templates/search/search.html create mode 100644 search/templates/search/sidebar.html create mode 100644 search/tests.py create mode 100644 search/urls.py create mode 100644 search/views.py diff --git a/logs/__pycache__/__init__.cpython-34.pyc b/logs/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eff4daeed1deb37c425870283c909bb0fd85195c GIT binary patch literal 113 zcmaFI!^`#QRarO#5IhDEFu(|8H~?`m3y?@*U6$3E?0PX@A0ssI2 literal 0 HcmV?d00001 diff --git a/logs/__pycache__/admin.cpython-34.pyc b/logs/__pycache__/admin.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6cde33cc4827188feae1ede3c4793e43ecc78ab GIT binary patch literal 158 zcmaFI!^`#QRav+_0|UcjAcg}bAj<)Wi$#D$3J@_e_VBLBJmA5!-a`RJ4b5iXXf$EEam;nIzf+SD? literal 0 HcmV?d00001 diff --git a/logs/__pycache__/models.cpython-34.pyc b/logs/__pycache__/models.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e475a667aab3c52fd4e8c44e1f4ea48e597f25a GIT binary patch literal 155 zcmaFI!^`#QRav+t0|UcjAcg}bAj<)Wi$#D$3J@_e$# d^3#j;Av*O6DsOSv0NJHEsdkJ&4aGpr0055?Ba{FD literal 0 HcmV?d00001 diff --git a/logs/__pycache__/views.cpython-34.pyc b/logs/__pycache__/views.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e136851ef2a31a0d7e8b823821e01daac62abf6 GIT binary patch literal 295 zcmYk0y>7xV6oro+0tgkAy$frWSYk$1rS2>pDrH013ZMkTwUe|}xAtZFN?Dn@@Bp29 z?Ezu=9AE#O@A`5#ot!W2YYE`Yx(>$p2_9ZzdS0DG4EuGqN>Mh^;y2=EF-pm@2IW@-lAJBkL z{vK4jCe?MFBD1h6=GvXZ`RixNvR^Ye=JUmnf?1dl-k3@`#24nSPY0whux7=kq!{Z=v*frJsnFD3o5#3KFj@^by6 sRHJ8;s6wbaRASl58+aVAUiJ6*+{f@1mi9!A5;j>9x&=_LmX7cg=7T7 zwEKZPAZ0cvWL-8N$QM%2cKXHWu56UuS{YZ%sTxt~dUU(n%}&yCWS&+x24>ODI5(YYzNkq}K$Dkra^fun@;Oi)RD0H@1EHbT5Ct2OnHa*u&; zGenkq8}o3Ybc8*Fl&y8>F8Vqq*dj;>et5Rl4#jp6sCP|>{6QM$J91n!x0B=1q?zgR zMiXBf;y_eoH2prBWZ1Y*k(L5!bLUxZ%9*l}R<}4PrT@FwMrZAG&q=W%rhDFjcjzDb G`|KN0TahmS literal 0 HcmV?d00001 diff --git a/machines/__pycache__/models.cpython-34.pyc b/machines/__pycache__/models.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8529d171862d19bb070b45f338953c584d801b3e GIT binary patch literal 939 zcma)4&2H2%5FY10X-cbdDL1aUBvQ`^Ra(&=pbKIbkaDrY#_W&sQ|#R?t+;JpfrsE( zcmrQK^}+*iff;980ull%9y>FhnQy+CZ}D#QLQ1}!d}mM)Z@F?cr9HHHmkd=D(lKl&o8ylxmrrj>AA8{0K3}TW>2@aVG`l35d>ArW#wkKse^yQ+G$9x z;bq`ic!Irh>V*g30<-IemO~{R?|61H-#6dP+CTjT?|XZE^vweJ0aq^E!#1w`5DmlI zfEXY#plg7k_5@-Ai3wd35(~Ok88soUK-Y#>%mP+{FPK;XZo;4nGt8|5GvR$;pCc&* zhOCd$sFyKLwjPrmG^LwNDQcBF1f48Mfr*@FG-P2moH*@<0_e(r4(VjKwj0^)YJVnKA?XP zkZIZO^tyI~x^$?nNvZTGMGd2vqwiDtX%xn)Q?+A!$WzACUc_@@D!H{?-RZs(Ei4sr zcW|0}YFyIYJq<Oc3$pwq?Zlx zOVF?XR}cZRYx8Tfc@~Q1csyY^ zYuMzmsq8~zT|M!)LCUAj4jeU!lTk4e*t;NzlWwWE!H#wJWy5QKgN^bNZOl6n8wk>5 Zm*PwBkz#Y6m2-ZsxN{p#ovawX`3C`{E7br1 literal 0 HcmV?d00001 diff --git a/machines/migrations/__pycache__/__init__.cpython-34.pyc b/machines/migrations/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42cd9a8d55e6a398fe9c8468b678979f4f72cea3 GIT binary patch literal 128 zcmaFI!^_2>Umnf?1dl-k3@`#24nSPY0whux7=kq!{Z=v*frJsnFJ1kz#3KFj@^by6 zRHJmTC ksYdw_B0fGdFS8^*Uaz3?7Kcr4eoARhsvSsQF%UBV0G3M_2mk;8 literal 0 HcmV?d00001 diff --git a/re2o/__pycache__/login.cpython-34.pyc b/re2o/__pycache__/login.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74cf5a889bc70c02feebc97cfd372ab3b43c54b6 GIT binary patch literal 1124 zcmZ8f&2AGh5FUFs-c6d&9~BA$^}ua~LkhnPE^L+-)AhqwleVmxOHhy%2JkTv**IYN*EWZ?8VNHptCZ_p#1s4>SE zp&c>1I?=gF4%I<-XIl-^kyN*wQjs%d6o4Q006wl=T;>Cc0-%poGPqzcV^DDDdr+d& zhYN5{4kbEkP`W!zawvS~5_AK-8yMOT$k^yaUVBdY&&AhH=iQrG6k0wqHkjySC`SVu z^b*s{v##|`FL`D~RkIb7u}lhOh0KnWDR6gXN1hGGi80fWmKc%bg=M{;pjYsP%ZFPh ziQbw{r(0S*A5|hB9c9C(<1^bBB*&_wQmu*xwHl%Tw#@Fb7Sn5}FAyOXJzTrE%o7v~ zLM*1lAg1sMTV69jsvL^w)b9g``I=;|GqR2Hv zI&t*e^f}vy0{OyQD7`C^k=`0{ULx%bC((nMfYTRH-~lGUGspG?hqs>}!6y#00A?YS z0?Gi&5RN&#$A~Wl?4z#}`R%#D`sV8>_M$*Had#MLVxq!`h_T*zHg;%5^>{7qC3&uf zN9y2;bq80xe0|V8E0l2o`VPhOo{sOFBzYzmF_vYP^>3rwN_#3j{`h~Is4hcu0PG%H z!58ATpI3UEyhZWsO5Nr2@DnOtWE07R}1%%W?yV=-nQ^j#)yW8Df z_t$Xc&L7E@6Bm8}2gKOvih=|pQ6}T(@$HbcwlkX0k#D!MBH1)cOAa%@SP2O*Wr5(@2&AErVs+V1#hF<$$cL{@gqszpS~u? zvY2Gkg-T2&i!gjQqrk{@|-b}6eJU+RAxZPL`gx!)i^23HMkLfw2pU@QNV^mT#BOu z)gSHmAFP$lq~H%okqG{zZ~cB09_NYH56@8=+u;3M9@5OXvZ=(bR5uB|L@t;Af9GRY z#EBkTnuF+%oL&`azF=7~#X`6pt-KTu^tT%QQ}cN)rxbN(j*1`jEfCui=toib6-o~g7>~0`$qHYz8$Jk=yan-Av47;nCxKM@t4hruv z40nIc8I_%@rUgTktm}hPEd;8j&J3@bwhC1j?agKQ2x`w#S@ZoKy+{;YE|=8arP|mP fad}mB9t+79Ie)r~k-CSb?cMQuey_3Z-F5FzAnQp_ literal 0 HcmV?d00001 diff --git a/re2o/__pycache__/wsgi.cpython-34.pyc b/re2o/__pycache__/wsgi.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c119761637d431cce9ed32ea524bfbef9404b04 GIT binary patch literal 528 zcmYjNO>Yx15S{h5Nwu_6B@hQrzD9zz;DiuDfLfv;NDpaMDVL2|Pd1Lc_G;~BX>X{% zhX2Bmldqh(@B=t8n+PeE{WO}7_nzm^@k#dMDqMd{0Di&VNhy9y&%Y;70CU0w6a$mM zoC3Nj7zT9;^Ar+HV0{4VLr@2x4&k0rDusKR8}vi7(ctc9c0C(Uc`h7^XPe4A>VaNW8@cuTzW2f?bMCIX9hQD_(ryRTe7l7#TN_NG)9*) zXlEA-;`=}nwQG@UOKSDDz?~&>?fFt0e9ApywhE!~uY^#p^toC~Te<(9N>>ZC;(7j3 ztXvnIP}mrETcZu4^OY9aZ`uw_M@f8CVJP}sv1cPbKKuA?I=(1o=a-k0>3CLrzBs%3 zbbfcze?9jYg0__(4dbvVNWUl|b3UH#T;wI0&wI|6kxCq*-RRcYn9-oZrMxjAKG>7{ r4sAw_Tlo7#(1JwQb)whWLC=*pxAExpZj*10sNMH4V8`r~J!Jm?8Wo;z literal 0 HcmV?d00001 diff --git a/search/__init__.py b/search/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/search/__pycache__/__init__.cpython-34.pyc b/search/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfaea68afdf2a0e5773b3ecba89fd236350c6285 GIT binary patch literal 115 zcmaFI!^_pOqBNWV2p)q77+?f49Dul(1xTbYFa&Ed`mJOr0tq9CUkdtViADP5<>mTC qsYdzw#i@x!$r<|b@tJvm}#sl@w(r6@d&{$xy@$q`<^4S^cuaBK`96a{Z!I kqkR41)Wo9X41KVEy@JYH95%W6DWy57c8owB#X!se0NlwWVgLXD literal 0 HcmV?d00001 diff --git a/search/__pycache__/models.cpython-34.pyc b/search/__pycache__/models.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3d7cea6936f91d4aaca7109c7d5daabff2c59fd GIT binary patch literal 574 zcmYjPJx{|h5Pi;fq97H103)JHBQY=`R0*j}bg2+h7AvjYmda_tp|s59&+wPLGIikx zFmaBHz{y?S^IhJZPyWh}vdgpW!!ZLs@oxo$`((|6oS>IM0X0L(z%2KmJk&l)-*F!* zKpmnC9S>R_p^O|4p<>ht$^`6IL=Z9FNhXF2u_KujBEhJe?x`NS%tZA{NYxMurz>4s z5DW;=H@&l=0}1XMsVDZQ-xU(*lQrk$By7jjaOpw%SOoSY)V%N^0_@;XzapfHKD4;QklqYnXIn1T*>9^WxgjZ3@JU~d|B0!bCYpS&90TjIp@#oO1X&kDc7Vo z^GXjMr4lA@+7f(f*$4D7#as7%TD(@e*lae1mKUqSQF0R*ant^fc4 literal 0 HcmV?d00001 diff --git a/search/__pycache__/urls.cpython-34.pyc b/search/__pycache__/urls.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0edb38a3e52f9362cb47faff5697e89cc61fab4 GIT binary patch literal 263 zcmX|5yG{c^3>@#?9Z>-3K7f+unp-I~0=|HT0x1R3D!YV4_lUf?J3-6Wq~m+GrAosG zP~laiSoU~idq)1fx}JX@hL;h*kJLGGVUJSbLBL588lWXC3FH)SdG-EO6|r<%+pYV0 z)pu{TXaXw{MQ|pKi^MNwytDhg=Pn$;^R!6tcVkA&W|}6$e$ktgsYxdF?jz3b+TIO~ NzfWI;WLK(E{{xI(J(>Uj literal 0 HcmV?d00001 diff --git a/search/__pycache__/views.cpython-34.pyc b/search/__pycache__/views.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d6cc7253a1fc05cf2590348ee4182dd3b724bed GIT binary patch literal 1685 zcmZ`(OK;>v5U%!nCZ5b>@>&o?TrI5LL-UYsEwINhfsAs@uR*s%cvuKhq9uQFf^=8a=GRVT;7MFtgm= zGA$dWvnCgbXM)YT$h43?MwN7)43VJ0&GoH`w5Zn=+D#}eFvId+K^~&dKOdf5XY%ak z=H^U_C+(T)?tOM$iW_yher3ERLYShXqN@W7*gliT$mNV=eCQ-Pw}bT=Y7rI!!mIz} zfQ%R+LyZIL6KXZYcZV7VD;MtZqJMY1M=kdr8nh3q09GOB2nvLb3Bi0I@AdpM68u4+ zXby$NM3NzR@J2W|ks%s{I}h}zKV$24*YQD*|Emc=??8!1V(bx|Qzgc@`P6{t+ko2d z9QzM(-Mg?L-wqOX;(0NBqkaSYm}bfX{~uqpFOu1X@xJ+b@x6&{71CuXs)FyWmDm(* znwC`g49m`^O;(GCin-dzw{^!GY|}J-_w7S#c-#MxRlgg_jLD+Xs#KcCwe9y_TH2Pk zQgoR$9rt>#@1qiD@%Hpe*A*XI74_5Wd2hB`XHQ}i)Iwjih1|t%l8=y>s8s27R+WW` z^GalmC{pb6OpeJI+BsGxSe6wwzZ}tf6CyiAs7sSj?&D?xdy?@xBqr)XDC6Ux%U3+= zaVYK~2Gxy*B}WwMBP0j7)cZ()P1zxf*@S(9HRMfsYsBQ|3nICh`0nG^f}0+$1w-~a#s literal 0 HcmV?d00001 diff --git a/search/admin.py b/search/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/search/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/search/forms.py b/search/forms.py new file mode 100644 index 00000000..499e99fc --- /dev/null +++ b/search/forms.py @@ -0,0 +1,16 @@ +from django.db.models import Q +from simple_search import BaseSearchForm + +from users.models import User, School + +class UserSearchForm(BaseSearchForm): + class Meta: + base_qs = User.objects + search_fields = ('^name', 'description', 'specifications', '=id') + + # assumes a fulltext index has been defined on the fields + # 'name,description,specifications,id' + fulltext_indexes = ( + ('name', 2), # name matches are weighted higher + ('name,description,specifications,id', 1), + ) diff --git a/search/migrations/__init__.py b/search/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/search/migrations/__pycache__/__init__.cpython-34.pyc b/search/migrations/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..433a3221e5833286c3bc3e58d02b8da2bd3565f0 GIT binary patch literal 126 zcmaFI!^_pOqBNWV2p)q77+?f49Dul(1xTbYFa&Ed`mJOr0tq9CU)uU*iADP5<>mTC zsYdzw#i@x!$r<{&ndwD|C7Jno#rpB_nR%Hd@$q^EmA5!-a`RJ4b5iXRésultats dans les utilisateurs + + + + + + + + + + {% for user in users_list %} + + + + + + + {% endfor %} +
PrénomNomPseudoModifier
{{ user.name }}{{ user.surname }}{{ user.pseudo }}Editer
+ {% endif%} + {% if machine_list %} +

Résultats dans les machines :

+ + + + + + + {% for machine in machine_list %} + + + + {% endfor %} +
Nom
{{ machine.name }}
+ {% endif %} + {% if facture_list %} +

Résultats dans les factures :

+ + + + + + + + + + + + {% for facture in facture_list %} + + + + + + + + + {% endfor %} +
UtilisateurDesignationNombrePrix unitaireMoyen de paiementDate
{{ facture.user }}{{ facture.name }}{{ facture.number }}{{ facture.prix }}{{ facture.paiement }}{{ facture.date }}
+ {% endif %} + {% if ban_list %} +

Résultats dans les banissements :

+ + + + + + + + + + {% for ban in ban_list %} + + + + + + + {% endfor %} +
UtilisateurRaisonDate de débutDate de fin
{{ ban.user }}{{ ban.raison }}{{ ban.date_start }}{{ ban.date_end }}
+ {% endif %} +{% endblock %} + diff --git a/search/templates/search/search.html b/search/templates/search/search.html new file mode 100644 index 00000000..063ee55d --- /dev/null +++ b/search/templates/search/search.html @@ -0,0 +1,14 @@ +{% extends "search/sidebar.html" %} +{% load bootstrap3 %} + +{% block title %}Création et modification d'utilisateur{% endblock %} + +{% block content %} +{% bootstrap_form_errors searchform %} + +
+ {% csrf_token %} + {% bootstrap_form searchform %} + {% bootstrap_button "Search" button_type="submit" icon="search" %} +
+{% endblock %} diff --git a/search/templates/search/sidebar.html b/search/templates/search/sidebar.html new file mode 100644 index 00000000..debd89e3 --- /dev/null +++ b/search/templates/search/sidebar.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} + +{% block sidebar %} +

Créer un adhérent

+

Editer un adhérent

+

Liste des adhérents

+

Ajouter un droit rezo

+

Retirer un droit rezo

+{% endblock %} diff --git a/search/tests.py b/search/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/search/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/search/urls.py b/search/urls.py new file mode 100644 index 00000000..cb1247b4 --- /dev/null +++ b/search/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^$', views.search, name='search'), +] diff --git a/search/views.py b/search/views.py new file mode 100644 index 00000000..d27c4614 --- /dev/null +++ b/search/views.py @@ -0,0 +1,34 @@ +# App de recherche pour re2o +# Gabriel Détraz, Goulven Kermarec +# Gplv2 +from django.shortcuts import render +from django.shortcuts import render_to_response, get_object_or_404 +from django.core.context_processors import csrf +from django.template import Context, RequestContext, loader + +from django.db.models import Q +from users.models import User, Ban +from machines.models import Machine +from cotisations.models import Facture +from search.models import SearchForm + +def form(ctx, template, request): + c = ctx + c.update(csrf(request)) + return render_to_response(template, c, context_instance=RequestContext(request)) + +def search(request): + if request.method == 'POST': + search = SearchForm(request.POST or None) + if search.is_valid(): + search = search.cleaned_data['search_field'] + users = User.objects.filter(Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) + machines = None + query = Q(user__pseudo__icontains = search) | Q(user__name__icontains = search) | Q(user__surname__icontains = search) + factures = Facture.objects.filter(query) + bans = Ban.objects.filter(query) + return form({'users_list': users, 'machine_list' : machines, 'facture_list' : factures, 'ban_list' : bans}, 'search/index.html',request) + return form({'searchform' : search}, 'search/search.html', request) + else: + search = SearchForm(request.POST or None) + return form({'searchform': search}, 'search/search.html',request)