diff --git a/SocialHelper/SocialHelper/__pycache__/__init__.cpython-38.pyc b/SocialHelper/SocialHelper/__pycache__/__init__.cpython-38.pyc index 68a5269..c1d440b 100644 Binary files a/SocialHelper/SocialHelper/__pycache__/__init__.cpython-38.pyc and b/SocialHelper/SocialHelper/__pycache__/__init__.cpython-38.pyc differ diff --git a/SocialHelper/SocialHelper/__pycache__/settings.cpython-38.pyc b/SocialHelper/SocialHelper/__pycache__/settings.cpython-38.pyc index 4395923..e605027 100644 Binary files a/SocialHelper/SocialHelper/__pycache__/settings.cpython-38.pyc and b/SocialHelper/SocialHelper/__pycache__/settings.cpython-38.pyc differ diff --git a/SocialHelper/SocialHelper/__pycache__/urls.cpython-38.pyc b/SocialHelper/SocialHelper/__pycache__/urls.cpython-38.pyc index ed2bd05..ab730d3 100644 Binary files a/SocialHelper/SocialHelper/__pycache__/urls.cpython-38.pyc and b/SocialHelper/SocialHelper/__pycache__/urls.cpython-38.pyc differ diff --git a/SocialHelper/SocialHelper/__pycache__/wsgi.cpython-38.pyc b/SocialHelper/SocialHelper/__pycache__/wsgi.cpython-38.pyc index 7b342de..a8ed10d 100644 Binary files a/SocialHelper/SocialHelper/__pycache__/wsgi.cpython-38.pyc and b/SocialHelper/SocialHelper/__pycache__/wsgi.cpython-38.pyc differ diff --git a/SocialHelper/homepage/__pycache__/__init__.cpython-38.pyc b/SocialHelper/homepage/__pycache__/__init__.cpython-38.pyc index 307dc2f..056faa2 100644 Binary files a/SocialHelper/homepage/__pycache__/__init__.cpython-38.pyc and b/SocialHelper/homepage/__pycache__/__init__.cpython-38.pyc differ diff --git a/SocialHelper/homepage/__pycache__/admin.cpython-38.pyc b/SocialHelper/homepage/__pycache__/admin.cpython-38.pyc index 16c544c..13e3b82 100644 Binary files a/SocialHelper/homepage/__pycache__/admin.cpython-38.pyc and b/SocialHelper/homepage/__pycache__/admin.cpython-38.pyc differ diff --git a/SocialHelper/homepage/__pycache__/apps.cpython-38.pyc b/SocialHelper/homepage/__pycache__/apps.cpython-38.pyc index 00392ff..5692f5c 100644 Binary files a/SocialHelper/homepage/__pycache__/apps.cpython-38.pyc and b/SocialHelper/homepage/__pycache__/apps.cpython-38.pyc differ diff --git a/SocialHelper/homepage/__pycache__/models.cpython-38.pyc b/SocialHelper/homepage/__pycache__/models.cpython-38.pyc index f8f3775..3833db5 100644 Binary files a/SocialHelper/homepage/__pycache__/models.cpython-38.pyc and b/SocialHelper/homepage/__pycache__/models.cpython-38.pyc differ diff --git a/SocialHelper/homepage/__pycache__/urls.cpython-38.pyc b/SocialHelper/homepage/__pycache__/urls.cpython-38.pyc index 429b07b..c204693 100644 Binary files a/SocialHelper/homepage/__pycache__/urls.cpython-38.pyc and b/SocialHelper/homepage/__pycache__/urls.cpython-38.pyc differ diff --git a/SocialHelper/homepage/__pycache__/views.cpython-38.pyc b/SocialHelper/homepage/__pycache__/views.cpython-38.pyc index 1fb9067..c6fbc6c 100644 Binary files a/SocialHelper/homepage/__pycache__/views.cpython-38.pyc and b/SocialHelper/homepage/__pycache__/views.cpython-38.pyc differ diff --git a/SocialHelper/homepage/migrations/0001_initial.py b/SocialHelper/homepage/migrations/0001_initial.py index c7ffa2c..f117fdc 100644 --- a/SocialHelper/homepage/migrations/0001_initial.py +++ b/SocialHelper/homepage/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.4 on 2020-12-20 16:51 +# Generated by Django 3.1.4 on 2021-01-02 14:27 import datetime from django.conf import settings @@ -15,11 +15,20 @@ class Migration(migrations.Migration): ] operations = [ + migrations.CreateModel( + name='Places', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('city', models.TextField(default='', max_length=40)), + ('woj_city', models.TextField(default='', max_length=40)), + ], + ), migrations.CreateModel( name='Product', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('active', models.BooleanField(default=True)), + ('Wolontatriat', models.BooleanField(default=False)), ('picture', models.ImageField(blank=True, null=True, upload_to='images/')), ('create_date', models.DateField(default=datetime.date.today, verbose_name='Date')), ('type', models.IntegerField(choices=[(1, 'Potrzebuje'), (2, 'Oddam')], default='')), @@ -31,4 +40,13 @@ class Migration(migrations.Migration): ('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), + migrations.CreateModel( + name='Ocena', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comm', models.TextField(default='', max_length=40)), + ('ocena_jedn', models.FloatField(default='', max_length=40)), + ('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), ] diff --git a/SocialHelper/homepage/migrations/0002_product_wolontatriat.py b/SocialHelper/homepage/migrations/0002_product_wolontatriat.py deleted file mode 100644 index cbeedca..0000000 --- a/SocialHelper/homepage/migrations/0002_product_wolontatriat.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-30 21:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('homepage', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='product', - name='Wolontatriat', - field=models.BooleanField(default=False), - ), - ] diff --git a/SocialHelper/homepage/migrations/0003_places.py b/SocialHelper/homepage/migrations/0003_places.py deleted file mode 100644 index b262776..0000000 --- a/SocialHelper/homepage/migrations/0003_places.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-31 12:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('homepage', '0002_product_wolontatriat'), - ] - - operations = [ - migrations.CreateModel( - name='Places', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('city', models.TextField(default='', max_length=40)), - ('woj_city', models.TextField(default='', max_length=40)), - ], - ), - ] diff --git a/SocialHelper/homepage/migrations/0004_ocena.py b/SocialHelper/homepage/migrations/0004_ocena.py deleted file mode 100644 index 7c702d6..0000000 --- a/SocialHelper/homepage/migrations/0004_ocena.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.1.4 on 2021-01-01 16:53 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('homepage', '0003_places'), - ] - - operations = [ - migrations.CreateModel( - name='Ocena', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('comm', models.TextField(default='', max_length=40)), - ('ocena_jedn', models.FloatField(default='', max_length=40)), - ('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/SocialHelper/homepage/migrations/__pycache__/0001_initial.cpython-38.pyc b/SocialHelper/homepage/migrations/__pycache__/0001_initial.cpython-38.pyc index d0d8b48..86e6702 100644 Binary files a/SocialHelper/homepage/migrations/__pycache__/0001_initial.cpython-38.pyc and b/SocialHelper/homepage/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/SocialHelper/homepage/migrations/__pycache__/0002_product_wolontatriat.cpython-38.pyc b/SocialHelper/homepage/migrations/__pycache__/0002_product_wolontatriat.cpython-38.pyc index ef50b8c..c096e55 100644 Binary files a/SocialHelper/homepage/migrations/__pycache__/0002_product_wolontatriat.cpython-38.pyc and b/SocialHelper/homepage/migrations/__pycache__/0002_product_wolontatriat.cpython-38.pyc differ diff --git a/SocialHelper/homepage/migrations/__pycache__/0003_places.cpython-38.pyc b/SocialHelper/homepage/migrations/__pycache__/0003_places.cpython-38.pyc index e1307a7..a3998bd 100644 Binary files a/SocialHelper/homepage/migrations/__pycache__/0003_places.cpython-38.pyc and b/SocialHelper/homepage/migrations/__pycache__/0003_places.cpython-38.pyc differ diff --git a/SocialHelper/homepage/migrations/__pycache__/0004_ocena.cpython-38.pyc b/SocialHelper/homepage/migrations/__pycache__/0004_ocena.cpython-38.pyc index 85bf53a..a686e6b 100644 Binary files a/SocialHelper/homepage/migrations/__pycache__/0004_ocena.cpython-38.pyc and b/SocialHelper/homepage/migrations/__pycache__/0004_ocena.cpython-38.pyc differ diff --git a/SocialHelper/homepage/migrations/__pycache__/0005_auto_20210102_1308.cpython-38.pyc b/SocialHelper/homepage/migrations/__pycache__/0005_auto_20210102_1308.cpython-38.pyc new file mode 100644 index 0000000..38d3617 Binary files /dev/null and b/SocialHelper/homepage/migrations/__pycache__/0005_auto_20210102_1308.cpython-38.pyc differ diff --git a/SocialHelper/homepage/migrations/__pycache__/__init__.cpython-38.pyc b/SocialHelper/homepage/migrations/__pycache__/__init__.cpython-38.pyc index b32870e..76955f6 100644 Binary files a/SocialHelper/homepage/migrations/__pycache__/__init__.cpython-38.pyc and b/SocialHelper/homepage/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/SocialHelper/homepage/templates/homepage/index.html b/SocialHelper/homepage/templates/homepage/index.html index 9cb1efc..2e7a5e6 100644 --- a/SocialHelper/homepage/templates/homepage/index.html +++ b/SocialHelper/homepage/templates/homepage/index.html @@ -159,9 +159,12 @@

Wolontariat

diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index 09735ad..fbb5d66 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -123,6 +123,8 @@ def filter(request): potrzebuje_local = request.POST['Potrzebuje'] usluga_local = request.POST['usluga'] przedmiot_local = request.POST['przedmiot'] + wol_local = request.POST['wolontariat'] + if place_local != "": @@ -143,6 +145,9 @@ def filter(request): if usluga_local != "on" and przedmiot_local == "on": zmienna = 2 all_product = all_product.filter(type=zmienna) + + if wol_local == "on": + all_product = all_product.filter(Wolontatriat=True) types = TYPE_T