pola wolontariat do filtrowania (front)

This commit is contained in:
Alicja Kupczyk 2021-01-02 02:41:40 +01:00
parent 3bb08a79b5
commit 49d1a18d64
13 changed files with 15 additions and 3 deletions

View File

@ -77,7 +77,7 @@ WSGI_APPLICATION = 'SocialHelper.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql', 'ENGINE': 'django.db.backends.postgresql',
'NAME': 'socialhelperdb', 'NAME': 'postgres',
'USER': 'postgres', 'USER': 'postgres',
'PASSWORD': 'admin', 'PASSWORD': 'admin',
'HOST': 'localhost' 'HOST': 'localhost'

View File

@ -12,7 +12,7 @@ class Migration(migrations.Migration):
operations = [ operations = [
migrations.AddField( migrations.AddField(
model_name='product', model_name='product',
name='Wolontatriat', name='Wolontariat',
field=models.BooleanField(default=False), field=models.BooleanField(default=False),
), ),
] ]

View File

@ -153,6 +153,17 @@
</ul> </ul>
</aside> </aside>
<aside class="l_widgest l_menufacture_widget">
<div class="l_w_title">
<h3>Wolontariat</h3>
</div>
<ul>
<label for="Wolontariat">Tak</label>
<p></p>
<label for="scales">Nie</label>
</ul>
</aside>
<input type="submit" class="btn btn-primary update_btn" value="Zastosuj"> <input type="submit" class="btn btn-primary update_btn" value="Zastosuj">
</div> </div>
</div> </div>

View File

@ -123,6 +123,7 @@ def filter(request):
potrzebuje_local = request.POST['Potrzebuje'] potrzebuje_local = request.POST['Potrzebuje']
usluga_local = request.POST['usluga'] usluga_local = request.POST['usluga']
przedmiot_local = request.POST['przedmiot'] przedmiot_local = request.POST['przedmiot']
if place_local != "": if place_local != "":
all_product = all_product.filter(place=place_local) all_product = all_product.filter(place=place_local)
@ -141,7 +142,7 @@ def filter(request):
if usluga_local != "on" and przedmiot_local == "on": if usluga_local != "on" and przedmiot_local == "on":
zmienna = 2 zmienna = 2
all_product = all_product.filter(type=zmienna) all_product = all_product.filter(type=zmienna)z
types = TYPE_T types = TYPE_T