From c4d7daeb28b073f3e676e1c646f9c4823205a7d3 Mon Sep 17 00:00:00 2001 From: antreas efstathiou Date: Tue, 13 Oct 2020 13:29:47 +0100 Subject: [PATCH 01/14] hello --- .vscode/settings.json | 2 +- EDMS/db.sqlite3 | Bin 176128 -> 176128 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4c1277d..cfcbd1b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "python.pythonPath": "/Users/nourelgeziry/.local/share/virtualenvs/Equal_Distribution_maintainance-M-bcKwQz/bin/python" + "python.pythonPath": "C:\\Users\\antre\\.virtualenvs\\Equal-Distribution-maintenance-system-0ZHuoetA\\Scripts\\python.exe" } \ No newline at end of file diff --git a/EDMS/db.sqlite3 b/EDMS/db.sqlite3 index 486d8a046c29fa654a537759bd276924d6b107b7..431b5f72c4eacb4a293ed783d69378ea571f1c70 100644 GIT binary patch delta 425 zcmZp8z}4`8Yl1Z6o{2KfjC(dF{MKVs-5jHz=pbmUU}$7zWC}!jh9>5wW~Q6Z<(nyR zF!63<;JeMcZL^}nDqf8yB_>wi=3qzToK*9yobrs!r0j~a+zcb*vW)UF^CIKy6vHxe zQ_Gym%=0&U1$+4xSycqN7v$?&7N!{bJ7yJ?Wv6EZgjbljlqKcl`Uc0RhkAwtI{Fl* zXLyB~dZvbEhK5Gd x|D0k}n122kBmZ{2qm0+IfDS**!2gK6yVqjsg`CPu4 z0vjXWZ3e#En-vW%@@>97Pm_^@k^c?@5OHl5EV#hG`ObQc56mk3n$y`AFnR)2-Q=6D zxt{ShP{?;W`v$PkU%u(S`x&=0tFY=#XFmWGaum47vR&^e<25ZdM*c?({EvV}-QeH; J=s%;}1^^TuH_HG3 From 7cfe6d535b78ac77ffa140aa305a745b49dad0c9 Mon Sep 17 00:00:00 2001 From: Nour Elgeziry Date: Tue, 13 Oct 2020 15:00:19 +0100 Subject: [PATCH 02/14] database updated --- EDMS/db.sqlite3 | Bin 176128 -> 176128 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/EDMS/db.sqlite3 b/EDMS/db.sqlite3 index 486d8a046c29fa654a537759bd276924d6b107b7..7a7ebb5e5a134d0e3c63bfae6717fb35fed32679 100644 GIT binary patch delta 152 zcmZp8z}4`8Yl1Z6u8A_vjJq}_{MKVsZI0339;45=qJUYIUwJzF0!B|Je&x-I1{e9* zSeY3axm2fXu4lXrl=PU+z5yiZ0hIj4$I8OY$*4NrcR%BHW>uD3)7cLI Date: Fri, 16 Oct 2020 13:35:52 +0100 Subject: [PATCH 03/14] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index aacb031..9cd9862 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ # Equal-Distribution-maintenance-system +Testing pipline CI From a2dfe2f66fe26307a3a23e10555f48a04f571b15 Mon Sep 17 00:00:00 2001 From: "Nourelrahman Elgeziry (elgezirn)" Date: Fri, 16 Oct 2020 13:53:09 +0100 Subject: [PATCH 04/14] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9cd9862..dc68c92 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Equal-Distribution-maintenance-system Testing pipline CI +Testing pipline CD From 1577a6fca69226fd594edbae75cecbe682bc7746 Mon Sep 17 00:00:00 2001 From: Nour Elgeziry Date: Fri, 16 Oct 2020 15:02:33 +0100 Subject: [PATCH 05/14] Adding refresh basket functionality --- EDMS/EDMS/settings.py | 5 ++ EDMS/db.sqlite3 | Bin 176128 -> 176128 bytes EDMS/shoppingCart/admin.py | 2 +- EDMS/shoppingCart/cron.py | 19 +++++ .../migrations/0004_auto_20201016_1152.py | 25 +++++++ EDMS/shoppingCart/models.py | 8 +++ EDMS/shoppingCart/urls.py | 1 + EDMS/shoppingCart/views.py | 10 ++- Pipfile | 1 + Pipfile.lock | 68 ++++++++++-------- 10 files changed, 106 insertions(+), 33 deletions(-) create mode 100644 EDMS/shoppingCart/cron.py create mode 100644 EDMS/shoppingCart/migrations/0004_auto_20201016_1152.py diff --git a/EDMS/EDMS/settings.py b/EDMS/EDMS/settings.py index f52dfaa..aa7c150 100644 --- a/EDMS/EDMS/settings.py +++ b/EDMS/EDMS/settings.py @@ -38,6 +38,7 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'shoppingCart', + 'django_crontab', ] @@ -82,6 +83,10 @@ DATABASES = { } } +#cron job +CRONJOBS = [ + ('*/1 * * * *', 'shoppingCart.cron.expired_order_items') +] # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators diff --git a/EDMS/db.sqlite3 b/EDMS/db.sqlite3 index 7a7ebb5e5a134d0e3c63bfae6717fb35fed32679..3949114ba35618b3ca01cef955a432897fdacb18 100644 GIT binary patch delta 1194 zcmaJ=O>7%Q6yCS9>-B6BkKIN#Nn2REY2rA+-d(R_uOm^pZV+v(CMw~8NaeWk3hWr$ zbsd4Is#vvp;KWamMg>|TQMGVDq_PxWDm98YAr43!5VVJIDF_KsIDk~;!0Z;$mQq&x zzIikAzVGe4dE45STif#6dwg3Q$Bi*Nz>H_M@XmM~wyrH)Cde<(u1el9UY_k_ynE%t zhx{UUU@~+1m0G=Cs=k~pG@7ca8u`Ll0Bm zWf*a-^WI=vl;+7e@p-m7LG`jn_T1$Zch!0=pQpYu_zk}gY4Bi@e63Nm8a(-g3*blA z2M7Gf#13U`{D@SjsRR1oSYLPRR9!L&^FkpS_L9wM@=pL(7Y5r7vnOP2)Dh?d3=az!dRj|GO-(iQ#DfAdiiK^;Q#NJgQBE?d>8hF1^ydrJQnU1i z)sWHHh|LK6calU@Pa1Jmjn5WNHw!Fy_u!WFW~2Q8 zvk_)P%z_nGCPnc>~uUe3$ex_^@2$uCTIn<%2dVnka&wAF<^20(6cJ#F4&|nl(7l~Z83wz`hr9%2TnQBmO)J0Hu-H&s zear0+TCdkj4b~CL$y%+V9GjU_j=hk}jh@?gSPCSQ(0-Brc8QO5bCll#n5N_cpMxQ~ zumpSP*JY6DcO}?OC(96pqqJOxqY(UObBb2q=dTJq*SUE*umrPi*AW*h5696{AMn$H z=SQwhH8X);rt@KbCD0w^)d*~&j?`}{D^mQV!D2T7ao74z+;Zo Ky?v1%-1QfgJ{pn$ delta 607 zcmZWmOK4L;6rDRW$z)!d+?SLjCPms3B5ETqA(SE_7(WnbK|v6OK(tt@Eu?7_+=g^x z7lP##rYcpz?@lGq2PN2|f@@cWLLu2yDHf}XD$<4XTIj}sdpL9E+%w#nTFa=ljQd@o zMM6lQu9PmS>(Wd*2aE5nK1UWYW^G~iHF|r7jmB(Z$|FoHVmkP-(VKY@G=hIgw=9p` zDV6N370E?IEDN`8OjIg2%cEzmRd1Ijs@F%V6kn65{7+AW*>O;zF^B@U)0PD(yJ$Uw zNIkQV0bXG#Oe*md2K7~6f-3n2+FB|o@pf0*4ywWuG+BzTDzU7kym^;9tDoS|2_v9~ zASNN$ZiFf;sM;3oereJkGk`6^afRR?T)`i>u8%)sR!|QC3DTY2E2ZFjTQ1lhVP0^F zly0nE;FzcAcbvK4b9T;CpV`52li&{i#$ULpBiAs=nFQ_vbAd7@rJ*}HZn(y6+`^_%$I>G0@ KkF!2c6XAc{JeOYp diff --git a/EDMS/shoppingCart/admin.py b/EDMS/shoppingCart/admin.py index 4a85f36..765f09f 100644 --- a/EDMS/shoppingCart/admin.py +++ b/EDMS/shoppingCart/admin.py @@ -5,4 +5,4 @@ from .models import * admin.site.register(Customer) admin.site.register(Product) admin.site.register(Order) -admin.site.register(OrderItem) \ No newline at end of file +admin.site.register(OrderItem) diff --git a/EDMS/shoppingCart/cron.py b/EDMS/shoppingCart/cron.py new file mode 100644 index 0000000..d16f132 --- /dev/null +++ b/EDMS/shoppingCart/cron.py @@ -0,0 +1,19 @@ +from .models import OrderItem +from datetime import timedelta,datetime + +def expired_order_items(): + #get time now + time_now = datetime.now() + #querry order items with expired set to false + qs = OrderItem.objects.filter(expired=False) + + #for items in qs: + for item in qs: + #set expiry date = orderitem .date created + timedelta(minutes=2) + expiry_date = item.date_created + timedelta(minutes=2) + #check if time now < expiry date: + if time_now >= expiry_date: + #set expired field to true + item.expired = True + # delete order item + item.delete() \ No newline at end of file diff --git a/EDMS/shoppingCart/migrations/0004_auto_20201016_1152.py b/EDMS/shoppingCart/migrations/0004_auto_20201016_1152.py new file mode 100644 index 0000000..7dd980f --- /dev/null +++ b/EDMS/shoppingCart/migrations/0004_auto_20201016_1152.py @@ -0,0 +1,25 @@ +# Generated by Django 3.1.2 on 2020-10-16 11:52 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0003_auto_20201012_1250'), + ] + + operations = [ + migrations.AddField( + model_name='orderitem', + name='date_created', + field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), + preserve_default=False, + ), + migrations.AddField( + model_name='orderitem', + name='expired', + field=models.BooleanField(default=False), + ), + ] diff --git a/EDMS/shoppingCart/models.py b/EDMS/shoppingCart/models.py index 708d2a8..42573f7 100644 --- a/EDMS/shoppingCart/models.py +++ b/EDMS/shoppingCart/models.py @@ -1,6 +1,7 @@ from django.db import models from django.contrib.auth.models import User + # Create your models here. class Customer(models.Model): @@ -22,6 +23,7 @@ class Product(models.Model): class Order(models.Model): customer = models.ForeignKey(Customer, on_delete = models.SET_NULL, blank=True, null=True) complete = models.BooleanField(default=False, null=True, blank=True) + def __str__ (self): return str(self.id) @@ -30,7 +32,13 @@ class OrderItem(models.Model): product = models.ForeignKey(Product, on_delete=models.SET_NULL, blank=True, null=True) order = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True) quantity = models.IntegerField(default=0, null=True, blank=True) + date_created = models.DateTimeField(auto_now_add=True) + expired = models.BooleanField(default=False) def __str__(self): return self.product.name + + + + \ No newline at end of file diff --git a/EDMS/shoppingCart/urls.py b/EDMS/shoppingCart/urls.py index f769612..1eb81d2 100644 --- a/EDMS/shoppingCart/urls.py +++ b/EDMS/shoppingCart/urls.py @@ -7,3 +7,4 @@ urlpatterns = [ path('updateItem/', views.updateItem, name="updateItem"), ] + diff --git a/EDMS/shoppingCart/views.py b/EDMS/shoppingCart/views.py index db35600..fb641b8 100644 --- a/EDMS/shoppingCart/views.py +++ b/EDMS/shoppingCart/views.py @@ -29,13 +29,17 @@ def updateItem(request): order, created = Order.objects.get_or_create(customer=customer,complete=False) orderItem, created = OrderItem.objects.get_or_create(order=order, product=product) + #query order that did not expire + #querry orderitems in the order + #make sure the quantity does not exceed 9 + if orderItem.quantity >= 9 : messages.error(request, 'You bought 9 ' + str(orderItem.product) +"'s this week already") exit elif action == 'add': orderItem.quantity = (orderItem.quantity + 1) elif action =='remove': - orderItem.quantity = (orderItem.quantity -1) + orderItem.quantity = (orderItem.quantity - 1) orderItem.save() @@ -43,4 +47,6 @@ def updateItem(request): orderItem.delete() print('ProductID: ', productId, 'Action:',action) - return JsonResponse('item added', safe=False) \ No newline at end of file + return JsonResponse('item added', safe=False) + + diff --git a/Pipfile b/Pipfile index 66f5798..7a8362b 100644 --- a/Pipfile +++ b/Pipfile @@ -8,6 +8,7 @@ verify_ssl = true [packages] django = "*" pillow = "*" +django-crontab = "*" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 33c79b7..0301188 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "27d0ce8ecd9e1d08f1468feb6747fd86011dc9b6f199b0b9d97c65a0779d174e" + "sha256": "292744283c56cc32f20b13692b19ffe1958359200bfe6539399352866167da4e" }, "pipfile-spec": 6, "requires": { @@ -32,39 +32,47 @@ "index": "pypi", "version": "==3.1.2" }, + "django-crontab": { + "hashes": [ + "sha256:1201810a212460aaaa48eb6a766738740daf42c1a4f6aafecfb1525036929236" + ], + "index": "pypi", + "version": "==0.7.1" + }, "pillow": { "hashes": [ - "sha256:0295442429645fa16d05bd567ef5cff178482439c9aad0411d3f0ce9b88b3a6f", - "sha256:06aba4169e78c439d528fdeb34762c3b61a70813527a2c57f0540541e9f433a8", - "sha256:09d7f9e64289cb40c2c8d7ad674b2ed6105f55dc3b09aa8e4918e20a0311e7ad", - "sha256:0a80dd307a5d8440b0a08bd7b81617e04d870e40a3e46a32d9c246e54705e86f", - "sha256:1ca594126d3c4def54babee699c055a913efb01e106c309fa6b04405d474d5ae", - "sha256:25930fadde8019f374400f7986e8404c8b781ce519da27792cbe46eabec00c4d", - "sha256:431b15cffbf949e89df2f7b48528be18b78bfa5177cb3036284a5508159492b5", - "sha256:52125833b070791fcb5710fabc640fc1df07d087fc0c0f02d3661f76c23c5b8b", - "sha256:5e51ee2b8114def244384eda1c82b10e307ad9778dac5c83fb0943775a653cd8", - "sha256:612cfda94e9c8346f239bf1a4b082fdd5c8143cf82d685ba2dba76e7adeeb233", - "sha256:6d7741e65835716ceea0fd13a7d0192961212fd59e741a46bbed7a473c634ed6", - "sha256:6edb5446f44d901e8683ffb25ebdfc26988ee813da3bf91e12252b57ac163727", - "sha256:725aa6cfc66ce2857d585f06e9519a1cc0ef6d13f186ff3447ab6dff0a09bc7f", - "sha256:8dad18b69f710bf3a001d2bf3afab7c432785d94fcf819c16b5207b1cfd17d38", - "sha256:94cf49723928eb6070a892cb39d6c156f7b5a2db4e8971cb958f7b6b104fb4c4", - "sha256:97f9e7953a77d5a70f49b9a48da7776dc51e9b738151b22dacf101641594a626", - "sha256:9ad7f865eebde135d526bb3163d0b23ffff365cf87e767c649550964ad72785d", - "sha256:9c87ef410a58dd54b92424ffd7e28fd2ec65d2f7fc02b76f5e9b2067e355ebf6", - "sha256:a060cf8aa332052df2158e5a119303965be92c3da6f2d93b6878f0ebca80b2f6", - "sha256:c79f9c5fb846285f943aafeafda3358992d64f0ef58566e23484132ecd8d7d63", - "sha256:c92302a33138409e8f1ad16731568c55c9053eee71bb05b6b744067e1b62380f", - "sha256:d08b23fdb388c0715990cbc06866db554e1822c4bdcf6d4166cf30ac82df8c41", - "sha256:d350f0f2c2421e65fbc62690f26b59b0bcda1b614beb318c81e38647e0f673a1", - "sha256:e901964262a56d9ea3c2693df68bc9860b8bdda2b04768821e4c44ae797de117", - "sha256:ec29604081f10f16a7aea809ad42e27764188fc258b02259a03a8ff7ded3808d", - "sha256:edf31f1150778abd4322444c393ab9c7bd2af271dd4dafb4208fb613b1f3cdc9", - "sha256:f7e30c27477dffc3e85c2463b3e649f751789e0f6c8456099eea7ddd53be4a8a", - "sha256:ffe538682dc19cc542ae7c3e504fdf54ca7f86fb8a135e59dd6bc8627eae6cce" + "sha256:04d984e45a0b9815f4b407e8aadb50f25fbb82a605d89db927376e94c3adf371", + "sha256:06e730451b70471c08b8a0ee7f18e7e1df310dba9c780bbfb730a13102b143db", + "sha256:1f59596af2b3d64a9e43f9d6509b7a51db744d0eecc23297617c604e6823c6ae", + "sha256:233513465a2f25fce537b965621866da3d1f02e15708f371dd4e19f0fb7b7711", + "sha256:2696f1a6402c1a42ed12c5cd8adfb4b381c32d41e35a34b8ee544309ef854172", + "sha256:2ca55a4443b463eec90528ac27be14d226b1c2b972178bc7d4d282ce89e47b6a", + "sha256:30615e9115f976e00a938a28c7152562e8cf8e221ddacf4446dd8b20c0d97333", + "sha256:3a77e7b9f8991b81d7be8e0b2deab05013cf3ebb24ac2b863d2979acb68c73dd", + "sha256:54667c8ab16658cc0b7d824d8706b440d4db8382a3561042758bdfd48ca99298", + "sha256:59304c67d12394815331eda95ec892bf54ad95e0aa7bc1ccd8e0a4a5a25d4bf3", + "sha256:594f2f25b7bcfd9542c41b9df156fb5104f19f5fcefa51b1447f1d9f64c9cc14", + "sha256:5b5dde5dcedc4e6f5a71d7654a3c6e189ced82e97d7896b1ca5a5c5e4e0e916f", + "sha256:6bcea85f93fb2c94a1bcd35704c348a929a7fb24a0ec0cc2b9fcbb0046b87176", + "sha256:718d7f0eb3351052023b33fe0f83fc9e3beeb7cbacbd0ff2b52524e2153e4598", + "sha256:7c4a7ee37027ca716f42726b6f9fc491c13c843c7af559e0767dfab1ae9682d4", + "sha256:87a855b64a9b692604f6339baa4f9913d06838df1b4ccf0cb899dd18f56ec03c", + "sha256:8c006d52365c0a6bb41a07f9c8f9f458ae8170e0af3b8c49bf7089347066b97b", + "sha256:8e29701229705615d3dcfc439c7c46f40f913e57c7fe322b1efc30d3f37d1287", + "sha256:9b5b41737853bc49943864d5980dfb401a09e78ddb471e71291810ccdeadd712", + "sha256:b04569ff215b85ce3e2954979d2d5e0bf84007e43ddcf84b632fc6bc18e07909", + "sha256:b731d45764349313bd956c07bdc1d43803bb0ad2b11354328a074e416c7d84bc", + "sha256:c12e33cb17e2e12049a49b77696ee479791a4e44e541fdc393ae043e1246389f", + "sha256:c41442c3814afeba1f6f16fd70cdf312a2c73c6dee8dc3ac8926bb115713ad1d", + "sha256:c4d743c5c91424965707c9c8edc58b7cb43c127dcaf191fbcd304e2082eef56a", + "sha256:d6766fd28f4f47cf93280a57e3dc6a9d11bdada1a6e9f019b8c62b12bbc86f6a", + "sha256:d904570afcdbec40eb6bdbe24cba8d95c0215a2c0cbbc9c16301045bc8504c1f", + "sha256:e674be2f349ea810e221b0113bd4491f53584ac848d5bcc3b62443cfa11d9c40", + "sha256:e6ac40f1a62a227eb00226eb64c9c82bc878a3ed700b5414d34c9be57be87e87", + "sha256:f5270369c799b4405ed47d45c88c09fbd7942fc9fb9891c0dabf0b8c751b625d" ], "index": "pypi", - "version": "==7.2.0" + "version": "==8.0.0" }, "pytz": { "hashes": [ From 211febe69b452c248d4a34b15098198df3b78d32 Mon Sep 17 00:00:00 2001 From: efstathioa Date: Sun, 18 Oct 2020 06:14:47 +0100 Subject: [PATCH 06/14] Databases and some design --- EDMS/EDMS/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 183 bytes EDMS/EDMS/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 187 bytes EDMS/EDMS/__pycache__/settings.cpython-37.pyc | Bin 0 -> 2390 bytes EDMS/EDMS/__pycache__/settings.cpython-38.pyc | Bin 0 -> 2430 bytes EDMS/EDMS/__pycache__/urls.cpython-37.pyc | Bin 0 -> 1168 bytes EDMS/EDMS/__pycache__/urls.cpython-38.pyc | Bin 0 -> 1174 bytes EDMS/EDMS/__pycache__/wsgi.cpython-37.pyc | Bin 0 -> 580 bytes EDMS/db.sqlite3 | Bin 176128 -> 180224 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 191 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 195 bytes .../__pycache__/admin.cpython-37.pyc | Bin 0 -> 369 bytes .../__pycache__/admin.cpython-38.pyc | Bin 0 -> 373 bytes .../__pycache__/models.cpython-37.pyc | Bin 0 -> 1925 bytes .../__pycache__/models.cpython-38.pyc | Bin 0 -> 1928 bytes .../__pycache__/urls.cpython-37.pyc | Bin 0 -> 365 bytes .../__pycache__/urls.cpython-38.pyc | Bin 0 -> 406 bytes .../__pycache__/views.cpython-37.pyc | Bin 0 -> 1482 bytes .../__pycache__/views.cpython-38.pyc | Bin 0 -> 1626 bytes EDMS/shoppingCart/admin.py | 2 + EDMS/shoppingCart/migrations/0004_id.py | 20 ++++ .../migrations/0005_deliveries.py | 23 +++++ .../migrations/0006_auto_20201018_0602.py | 17 ++++ .../migrations/0007_auto_20201018_0607.py | 33 +++++++ .../migrations/0008_auto_20201018_0609.py | 33 +++++++ .../migrations/0009_auto_20201018_0612.py | 33 +++++++ .../__pycache__/0001_initial.cpython-37.pyc | Bin 0 -> 1475 bytes .../0002_product_image.cpython-37.pyc | Bin 0 -> 633 bytes .../0003_auto_20201012_1250.cpython-37.pyc | Bin 0 -> 836 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 202 bytes EDMS/shoppingCart/models.py | 12 +++ .../templates/shoppingCart/deliveries.html | 90 ++++++++++++++++++ .../templates/shoppingCart/main.html | 7 +- EDMS/shoppingCart/urls.py | 3 +- EDMS/shoppingCart/views.py | 7 +- EDMS/static/css/style.css | 11 +++ 35 files changed, 286 insertions(+), 5 deletions(-) create mode 100644 EDMS/EDMS/__pycache__/__init__.cpython-37.pyc create mode 100644 EDMS/EDMS/__pycache__/__init__.cpython-38.pyc create mode 100644 EDMS/EDMS/__pycache__/settings.cpython-37.pyc create mode 100644 EDMS/EDMS/__pycache__/settings.cpython-38.pyc create mode 100644 EDMS/EDMS/__pycache__/urls.cpython-37.pyc create mode 100644 EDMS/EDMS/__pycache__/urls.cpython-38.pyc create mode 100644 EDMS/EDMS/__pycache__/wsgi.cpython-37.pyc create mode 100644 EDMS/shoppingCart/__pycache__/__init__.cpython-37.pyc create mode 100644 EDMS/shoppingCart/__pycache__/__init__.cpython-38.pyc create mode 100644 EDMS/shoppingCart/__pycache__/admin.cpython-37.pyc create mode 100644 EDMS/shoppingCart/__pycache__/admin.cpython-38.pyc create mode 100644 EDMS/shoppingCart/__pycache__/models.cpython-37.pyc create mode 100644 EDMS/shoppingCart/__pycache__/models.cpython-38.pyc create mode 100644 EDMS/shoppingCart/__pycache__/urls.cpython-37.pyc create mode 100644 EDMS/shoppingCart/__pycache__/urls.cpython-38.pyc create mode 100644 EDMS/shoppingCart/__pycache__/views.cpython-37.pyc create mode 100644 EDMS/shoppingCart/__pycache__/views.cpython-38.pyc create mode 100644 EDMS/shoppingCart/migrations/0004_id.py create mode 100644 EDMS/shoppingCart/migrations/0005_deliveries.py create mode 100644 EDMS/shoppingCart/migrations/0006_auto_20201018_0602.py create mode 100644 EDMS/shoppingCart/migrations/0007_auto_20201018_0607.py create mode 100644 EDMS/shoppingCart/migrations/0008_auto_20201018_0609.py create mode 100644 EDMS/shoppingCart/migrations/0009_auto_20201018_0612.py create mode 100644 EDMS/shoppingCart/migrations/__pycache__/0001_initial.cpython-37.pyc create mode 100644 EDMS/shoppingCart/migrations/__pycache__/0002_product_image.cpython-37.pyc create mode 100644 EDMS/shoppingCart/migrations/__pycache__/0003_auto_20201012_1250.cpython-37.pyc create mode 100644 EDMS/shoppingCart/migrations/__pycache__/__init__.cpython-37.pyc create mode 100644 EDMS/shoppingCart/templates/shoppingCart/deliveries.html diff --git a/EDMS/EDMS/__pycache__/__init__.cpython-37.pyc b/EDMS/EDMS/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a757e90a7883550179f902be30f0557dd3322aff GIT binary patch literal 183 zcmZ?b<>g`k0?@gVv!h=2h`Aj1KOi&=m~3PUi1CZpdI zlbBahlp5obTAW>yUl8M3Selrl8&H&=m6}`v<+)@QmlS0tm6l}Y=jrAqX6BWo<|XDO ur|K407MG;v#<;rp21AJW_{_Y_lK6PNg34PQHo5sJr8%i~Ae%n}F#`agKryKR literal 0 HcmV?d00001 diff --git a/EDMS/EDMS/__pycache__/__init__.cpython-38.pyc b/EDMS/EDMS/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0387fc7a9d094cfae7111419c0a6952ebd61bc31 GIT binary patch literal 187 zcmWIL<>g`k0?@gVv!h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o11u*(xTqIJKxa zCNZz1C^g0b-YaFsZmDjIy+LC9Tav<}Tx! zuSI`EfjqR2{Xc!;YoGcT`qUvQ*@7IPu4t}@b9^&9J2SgcDhV9?D!=|>@+FS@EB=`L zia@-Em;MP0;tURDP}a^kStFa_a2Dr&&iuyz&h5|b&l!1?GYW_|iUZD=M{_8T3aE(Y zk$^4?3Wk6dPzf!fi)aa5LYIMa0bMZ`(A5ElcytY2M>o(-bZfwq47&Y+A7qRYS~eEZ zC+Jh0N1rWo=<^R*k})nK5v_oZh`vbHJIVSb$qaa73Eed=p|6a~5XBXEuflr`-7~JE z`^F7GDKB$?dlRV2GH2XE4>Yd)&?;v*PEhtOci@Q>Ge+D275knqs!CH6N4~d@drT69 zE$m|7Vi<{g$KpMd7_3^zA+AW7<+HKoJu#pFA&wE(r8Vg>SZ@NLRDLtsr{_xrB=bj#3O}8cWJeT=oPfAi4UYX?vfWJJ$ zj7_l1*zpL{@WzagVoD*YX9W%jtN~cup0!|b481t{)L5WHZ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ls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1eea2611d27ae042fd4c59abb33d5c2dfbd1600e GIT binary patch literal 1168 zcma)5&2G~`5VjrX&q-Q(;<~rgsIgTzREhvml2lZp6!qs~MRK?HCUNlYn%yT&DN zytC$3&?Q~cB<*Dn_Ey~fVjUPkH+Ieqw}Yu=7?bhIIl4T1jYgc!l6fw$N;q?ziv>Yf zxkxjt6cJ2bp)`>S37#t=^#zF(M;{XMQF`cz3q-jfC}A@$Xc+=!DZ!E;NyyMauog;X za_IXpkE9nbF`M&D@Fj_q7jfzn=0EZFeZ{jRlD>BKA-(jS$tO%9mK-`qIg2#9RoXJ> zzK0Iu7-5DInsK3q2+ahih~9)a%PQlB|KrNPEEx*es1U9~v5Vb)f3K=*!71583{&!~ zul2s`j8ZJ+;2H{xH=_Oz1y>6qG!U;OY7OTV#46F>6OH!wuncvOUH2bE$1FU>sqg z%BbMjgNDi}VJZ}yt2gd;(F{Ydg<-H&)dh4Ykz5PtccbWR6f0mH4Pk=_9{%;6m7%>A z6rm^d&m~Q)XlRQq6GaMJQ&w~~+NfxsOvcBDA-qE2tkkp9(~ED0*wMMP_%$63rCs?DS5sPx#SiI+w7VTV0UZqt^Ec?4r=27 literal 0 HcmV?d00001 diff --git a/EDMS/EDMS/__pycache__/urls.cpython-38.pyc b/EDMS/EDMS/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14825ffa8b2257788fa86c186a8d8268acb6326a GIT binary patch literal 1174 zcma)5&2G~`5VjrX&q?}o;<~rgsIgTzAVq+vl2lZp6!qs~MRK?HCUNlYn%yo^c0A=T2ZX2;*oeDm$hWv}NL@ICzUDg0J5jPLre`PJd@0+vi+ zi;cjD&Dcs!Y6X_5?OIx+c3{(bP%qDR+Mvy#S=#lqMcYB!G>9EHh_!TJ1W7`M4uWr? zR3?YMAM;3h@e;E+&jeqRNO=*bK4Jc2@4#0)OCsrOun*~_?@T^o3bEwSIm%h2*{#x+ zK@U817{>@Rl+cU|HAHA8I7Rd(#93B3H}H=td|5ISuu&mgg<=rT9}BJ)L}(&jDb$+IONdpnzb6}w_pl6gkUjSwM#n5l^EhF1 z5TVScON-z!*ZLfn!XTgm&!e$q&qcFJ%Hc|`)pK}S@HNQ_yI+cOZ?@MdpZg%-I#XXe z%D8>kb$&pP8?IT@aZD5DT7|6@FPaq^{xqb5?uo!^Num^#C2t!g+AoaTUAf>{2F?){ zs*DQ29yC-=2~(lqT)lR;i)I*tFARgNsxFX2iR4;9zZ*qoqgVkWX$Tv(;K5()tPJg~ zs0clwe=ccZMMHaRnJ7}&TC$?E(MCo4WHLTJ4B-_DXJww9o?d)4#IDYzx1ZC|aC#|; zkW&oA$aGBPTWI|0F#kJSERf$R&4Rv$wnEj@dQ4HCVsw`fr1$Yxn>F literal 0 HcmV?d00001 diff --git a/EDMS/EDMS/__pycache__/wsgi.cpython-37.pyc b/EDMS/EDMS/__pycache__/wsgi.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f83167b6dfb192cb6b614d8321c26b1cb3cc34ce GIT binary patch literal 580 zcmYjOO^?$s5Ov({wh9z+KzsJJh$bLzD}?w+w<==0NZA!q6)E+`)6~Tu!FIcJuZSPO zksBQOKb&&q#9!cq)3DNx-xhBzwBcV49yV> z7#6`i@OwvK*_n3&1i`xd{eX4Z!4K@c&Sx|~WH?2`!|Pw+`*boTg;q;mlBG6eoSdel zGI|Y#i^6c~2z;uv1xwrtNSjTCpqBy&wS*F>*+#%fz!n7AQp5KlMI|t@SkS5xyr7P2 zwOIIiC!RuT1B5HjCielNl`qaMS#kl7hy@5&&QaS#t4q zd_8Es9$9dXtI`g8buZ67f1cM^+xmX1A}YN2sHthNXQ_Ljw%lk{hyEdhCEW;D-?>Hi z6Padwd-$8ZKF%&I7@JY$3}gw|4^CIv_~V9((YvsM^*2XYDMW_dTI)po{zXF20BV0WL(hF#rGn literal 0 HcmV?d00001 diff --git a/EDMS/db.sqlite3 b/EDMS/db.sq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bzZ!PE`v3p{ diff --git a/EDMS/shoppingCart/__pycache__/__init__.cpython-37.pyc b/EDMS/shoppingCart/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fb66bd8521b96f35bb685548907e098058202ed GIT binary patch literal 191 zcmZ?b<>g`k0^hl<@gVv!h=2h`Aj1KOi&=m~3PUi1CZpdI zlbBahlp5obTAW>yUl8M3Selrl8&H&=m6}`v<+)@QmlS0tm6l}Y=jrAqX6BWo<|XDO zr|K407MG;v#<;rp2FDa<1G(Tc H5HkP(i+nYq literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/__pycache__/__init__.cpython-38.pyc b/EDMS/shoppingCart/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d42b2bf4131ef93254aa5f2e7fcc9e48ade7729f GIT binary patch literal 195 zcmWIL<>g`k0^hl<@gVv!h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o11w*(xTqIJKxa zCNZz1C^g0b# zM_|Py6sco*=6kmE#^dwx_<&$Me7-$?WBqEyf5Zr9xZMRNK?JRcq6oHq(-aBGcdN*|IND^L%+a_K>Bh#jFvmwsS+%b%UR#5t#DzFE>pz+e^Tyd#AXs%1h-5Q%KHY={?%srdBmU=nm*0XM$ YNxcr~2|l=~;Itjhwf{ScQ#$I_FA`*F8vpR%6OW2ZYzNy}^Z?ugmYjgQc+09B zffbX`MaG($_r}tj&uTh7B4`g^Z;wBizgyC`2+0MyyTl-fpcPScO(_ur5mkeG0(2X_ z4uQJrwLg^2zz#ce3Sv Xy$i`14%}35-md1_8>dl1)9(ENKF4V; literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/__pycache__/models.cpython-37.pyc b/EDMS/shoppingCart/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44c4a2b184f0334bfb0a9e2fce406f3879ea67e2 GIT binary patch literal 1925 zcma)7%Wm676y@+CJ}fy-(-uY00)1^%z*+}EQ8gEu(Kfq5Hx2jQ{h7$4uQDn zF6}ZO&|SOij}-le*>;s*=&JXSlxz!DQwnoAbA~f>@40u5o(=|qLC;se{u2FZ8^+%l ztR5O02h=J~h8vt^M$SUU&^I$Pw?c~<-x}QF_Rj{l1zXs!t{I^-OEcZvWj~4i%Q4@@apMN=YU!@AtQ{CaU(Q^wXlUl zw#OO$%r|!E(#Rv{7`NY;p--b=J=$qq4Ex-rV?FJS>q?cmkY__n`(+W)=|Tx@7j>3t z=RAvxmv8@~^M!qv^_gP97UW9yepAi{9(vG z&Hr;Temp~b)hsTQ6tjt_UaE3AoBmM8+5Y#kT!=(m&!&@Sr?cv^TrSgMK8~fDwH%I?SK5stS{y|?@XRD*upjqUA&+1~teiXr>c1B{o9y~9^SxM$F6&aTnFn9dqbo^v8)pkuWX@7hf%XS(yrh_SY zoi%`V1p0E9@P>&SW&jMO2L>yTjK|(*yKL8N&|9UjuFyyH+09Zw32=+jP9^bM?{}js z29waH7`pTaUHV<3n%9YvIPPp{N}t|Ma;XnLq)X<1C0ZiZA(NnbGb)7pfZ8er_qt=R zGq5A?Vcj0geHf4}KY(dDJj}{iH5`V{Ql^Q}!BHO1+can=MSnZ3AJIl|qN8<}d7u^O zEm{%r0Y2NLb?Xho9kW7zgI4Fcm(1njBCa#Fg&|u-KBX)#eYsKSE;za_U1YrgF9>fQ}~3+ zl%K(T2?OG^Q=+JJ|A+*TYQ4(@=~JOnb+tVcU(jL%x|WnC7eG&jzV`VdF6QNkpSSw< zup1{O33GZrifeT_Y6Z0wJLehxp_)o*-Gp-z+ugYJ5P1nf)85yuntlU9D=^k)efvF+ Ge(t|kQ;I79 literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/__pycache__/models.cpython-38.pyc b/EDMS/shoppingCart/__pycache__/models.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae56e6ef8609b470c7d534c1db3503b55595608f GIT binary patch literal 1928 zcma)7%WfMt6eZ`Od029sCy<~4+%6g@fVB>SAV?y~g;B=|AbB$oFc=SMd6ao591ai{ z-6dJ(1F}n(`jH~vz-?Fgg{*onXC$jm)RqFT$U~95JontI<4(sX(C&YHAO2|(@)u6l z8(`!K^pb&Lgwd2_G@um6MrvecU{dl6VJ5TQ5oU2Zv)-D44T#NJfV3K<1&G63K->m# z0P&a)h~FSC+ZvH>`wQGex>U8Yg7LJ3k#$^h5hJ|bS}=J6y&QnyB%q801~+FGx52g; zg^%&U3LKcZ;2>qz2P5!c=C5X3wVOekIdHYB+hZB5fIf-&9_+-G#SF)H-hOetA-FqpD8INT%8ziL^$w?)XBHzoRB$qso@|f?H z=cVM?WH@*}nv`e7e4gafekA0i=CU_GS56qh<}lns&kQhx{UNYHhUjM) zDnATif0g369fs&oy&`bG>b%JLxB#=C@RSJ?F{l4@)PFh{DyxDwDX)JPiF&z%%l;6& zPBoxxj$?5RaLvS;xr!J{5E(38FfP48x9PT_(QhQNQtJcw>AECP3e1G?gET(1{veGg z3_!Ig8X5SF3>=`FRk0L!vY13B{8As zTRI||=&qqmP_;4=wvp~Tux&|qN4xSLWGjEa5ImXYzw&dfH|36oz>0m(*Wf-F!iR=et_} z8IMFoihF48quB+c>;i?P+6PegK;sSbP?mC;$n(w2cVY8g=&MSixkvP<>nV@TqI_EP z*hyX1?lkkbfO?#q^rA|h_3AoW*Est*{y}MF)Nby=Ndk{s%XXdjnDWYfR2R|5NN9;7 MZqv4P&4rKiH+Tw){Qv*} literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/__pycache__/urls.cpython-37.pyc b/EDMS/shoppingCart/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37b86f1ad44b178ee8ffbccbc6d66b7f5d70a9e1 GIT binary patch literal 365 zcmYL^OG*Pl5Qe+wk&JnGj}a305=2b0aG?mnO=yrdRU{LqA9nXBaqrRtcm(&JX11wCjqW9u;YIK&SmXbN$$e@&(fqapTc> zA$4#lX6WyOv10zv$a-|`%obPSmu8g@uDWYNW%MW-45+1E;mGeiSrhZwz>% literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/__pycache__/urls.cpython-38.pyc b/EDMS/shoppingCart/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f6441f120c8488694a2565a410e854a0bf56b17 GIT binary patch literal 406 zcmYk3&q@O^5XO`J({6X$zDEyj?;;|!6+9?H>17E>Y=$;Wz5J3x4(wtHv0udHL8Rj7+ z5Q+%sCK9n|y@g0^q*x>;>L9gVf>oHeMLH*g>_~CgfVy}q;n^G!JViCP>wR2usm3ny z$rlwbVV^a%;1;eelw+6v!M-D)kXz8Z@$DdSL~<*c8m8t!g%VYIrfc)71u+_C!-@td)bsI zlg}~K*D#!Lnv;T#DJ7h7FK0hk%+I~TAN#-v5At9f;2q{+5sf2Y5s%-Iam-u1jdzO& zugIu#i)>^>O(;dlg}kLpmu>;;exs`Ld!c4ksl*|GxDZMuCqhkan0+FQ0AmkBy@b&u zqZ#9rvn#rw+JomelzZI2ViUGt3$I~Wa2?)|g|DNGx>?ZBhBbZ@@ZfiU5$d=>-A#Du zp~C1;ddQ32S<1f}F%wT~rK>_n%&KCR3oS;zj1gmkO5zM=<1XSm>mF!Pn0O{DUQe}} zKT@aFY?hWMdx_M~izF>~PIZxwS|;AROB_|lnLx1dPJ}jrOJjPNA64>bDn+7&>AAg9 zBtKFJ@{&9^(aYs7(l%=pnMjJ)wNTnsCv9&{v|P?*2cGOMp{ms4t^R|^$MF9Zd%Ke# zm5^$Zlv;|(zEEennoVB3u9JKlTiDuG-hPVg>2a;os@%4R(V|Sssn}K*3Z+e6?0@@e za{t7W^HjW1JF^Sp+i+WjvQ-e;rvuuiZPusqDg6Ii+=2r#E?fLJCYoH+hGgsp4MuC} z6S81fsWy|8lU?-a5M-Pk#0LIMAJiu#fzwkvks5W0{KpN zuX`Xttoy*$F6k!Wtxa;nDADVblv|C*+hxV}~~J^~MdM zm?L-ZjLN@&Jg|s{A&V>oNuwpa8OoC_9%6`<6 z4_z2fbRyr!RDNKMRijJbZbv?XJ8n6_ST#DDFU=EtG3|PW^}>F#k?JEDLc27kF^e59 z2dqt>(hx`=qswCWv1RIWM2_0yb)F^VNwou}OFgZ%atbtIQK4pK2CL7fTF-Xm>WAhI uAfF+D>94*|Aw;Oj-Gvi@%YUz2t54}_jz2~2Iv1bWra1+nUgm}$cm4xdV}M`) literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/__pycache__/views.cpython-38.pyc b/EDMS/shoppingCart/__pycache__/views.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..670eecda0846c7bb0906aa12fabce0e15a243c7a GIT binary patch literal 1626 zcmZ8hOK)5?6t;bz^UR}D(n5h@1DZ-n7pxi~1WH;dNQ8>g1*4Ioo3Tmm&3#O5Puh&` ztkMM%${#>1l4Umh4t|4|u*zRx#b?h%O1YAceZG5q&auyT{HoJw5`0g8{p}zL3Hiq= zcRvQ@8w~XVf)h@2QqUo#gfs5t>?e!)xmWl@9~j|59t;D_VICIIFaj3w_#GL>yuq88 z8@$Ean43I!Nd}!8cqP}=gi@4T$QufEKn;Bi(f&?V<&Q#5s#1x40C6FdN{)mYTeI6Q z!Xm)f!Ejk>lF^KD%Gm{-Q|&?XYsx+DU$7CIv$$lTXaM%^l?Y0YZC4tVf~ zKM!?W;|z6p?jg%)U;1#4G+D}@Uo#Vrr%G3akXTj4Bo|r?eA$AH2`Y(mn6+DrAFR5k zMPcHJtoU@S)$9XxTumlvd9;&A{iI0Ja_d+Z`JiFqomwhcG<~}O)*+*=due;t}LLc)Z(qa zCh{Zb|B9XM(JLjS8YQKcVzevNiLNH2XRoJ8zKIYvx23k5!h3o+)oE33+QVp3CgoUc zsxyVuM$dM?e>u8);?Zd;-l(m~nenZ;y*AZ`Ahb(+v`L$+OXbJV-z&2%xjmCBv*oNN zC=oqpC=lD9J-Qp=2^V>KDr72@yIE;jJfQLcCU?Mvcm&nNOWU*i(3CYKRDJ^aUi1b4 zw8tX)-&kmJNo$g^D^LvNq7TWOVP=>;;9ll~TtOCQQH@3c5d$4VYt%mXdEkf`&LiD) zSP0sM4vXhe9cL{bodoioZeMnA##ncOt(?;h!W$dpicz9hDJdV<9&es7`McZE+8}j& z&?>f8^GPV_#F%JJ++5!yNl21#c8+%E!&d=4fe^^bAj&=WOf7bg#_4RS8`fr3d=_fgu z%g;bn&RtL0#xE+A%9eN5T9S8fce_7}zI6e&XHCoSK6VI>N5EIfFJf@t_!(XY6XaFG zmGKWNc=e~C?1JbUa3|NSShwPy6+H;kxYLjzbE#8(ChZeq0_?4%@xW&JnFW0DHq|!X zsW2f}f-X0~M1tVbQen_=d@?>ybRs_mBKuZYK062QcH~2-!-nfr`waY_e$D9w`-S~w zE!F1`gtlo+V-~xH=&>gKkcL3I7;P3qk8O*53ClrixXQDnJgTqTDjIYVNoGx zWqQls$68OeH)H=l1|Xa+ literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/admin.py b/EDMS/shoppingCart/admin.py index 415f397..5710063 100644 --- a/EDMS/shoppingCart/admin.py +++ b/EDMS/shoppingCart/admin.py @@ -6,4 +6,6 @@ admin.site.register(Customer) admin.site.register(Product) admin.site.register(Order) admin.site.register(OrderItem) +admin.site.register(ID) +admin.site.register(DeliveriesSlots) #comment or something diff --git a/EDMS/shoppingCart/migrations/0004_id.py b/EDMS/shoppingCart/migrations/0004_id.py new file mode 100644 index 0000000..f622ae1 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0004_id.py @@ -0,0 +1,20 @@ +# Generated by Django 3.1.2 on 2020-10-18 04:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0003_auto_20201012_1250'), + ] + + operations = [ + migrations.CreateModel( + name='ID', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('ID_Cus', models.CharField(max_length=200, null=True)), + ], + ), + ] diff --git a/EDMS/shoppingCart/migrations/0005_deliveries.py b/EDMS/shoppingCart/migrations/0005_deliveries.py new file mode 100644 index 0000000..f18a623 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0005_deliveries.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.2 on 2020-10-18 05:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0004_id'), + ] + + operations = [ + migrations.CreateModel( + name='deliveries', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('TimeSlot1', models.BooleanField(default=False)), + ('TimeSlot2', models.BooleanField(default=False)), + ('TimeSlot3', models.BooleanField(default=False)), + ('TimeSlot4', models.BooleanField(default=False)), + ], + ), + ] diff --git a/EDMS/shoppingCart/migrations/0006_auto_20201018_0602.py b/EDMS/shoppingCart/migrations/0006_auto_20201018_0602.py new file mode 100644 index 0000000..4a429c5 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0006_auto_20201018_0602.py @@ -0,0 +1,17 @@ +# Generated by Django 3.1.2 on 2020-10-18 05:02 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0005_deliveries'), + ] + + operations = [ + migrations.RenameModel( + old_name='deliveries', + new_name='DeliveriesSlots', + ), + ] diff --git a/EDMS/shoppingCart/migrations/0007_auto_20201018_0607.py b/EDMS/shoppingCart/migrations/0007_auto_20201018_0607.py new file mode 100644 index 0000000..cae735b --- /dev/null +++ b/EDMS/shoppingCart/migrations/0007_auto_20201018_0607.py @@ -0,0 +1,33 @@ +# Generated by Django 3.1.2 on 2020-10-18 05:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0006_auto_20201018_0602'), + ] + + operations = [ + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot1', + field=models.BooleanField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot2', + field=models.BooleanField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot3', + field=models.BooleanField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot4', + field=models.BooleanField(max_length=200, null=True), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0008_auto_20201018_0609.py b/EDMS/shoppingCart/migrations/0008_auto_20201018_0609.py new file mode 100644 index 0000000..b1adb71 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0008_auto_20201018_0609.py @@ -0,0 +1,33 @@ +# Generated by Django 3.1.2 on 2020-10-18 05:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0007_auto_20201018_0607'), + ] + + operations = [ + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot1', + field=models.BooleanField(null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot2', + field=models.BooleanField(null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot3', + field=models.BooleanField(null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot4', + field=models.BooleanField(null=True), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0009_auto_20201018_0612.py b/EDMS/shoppingCart/migrations/0009_auto_20201018_0612.py new file mode 100644 index 0000000..1f73c0e --- /dev/null +++ b/EDMS/shoppingCart/migrations/0009_auto_20201018_0612.py @@ -0,0 +1,33 @@ +# Generated by Django 3.1.2 on 2020-10-18 05:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0008_auto_20201018_0609'), + ] + + operations = [ + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot1', + field=models.CharField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot2', + field=models.CharField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot3', + field=models.CharField(max_length=200, null=True), + ), + migrations.AlterField( + model_name='deliveriesslots', + name='TimeSlot4', + field=models.CharField(max_length=200, null=True), + ), + ] diff --git a/EDMS/shoppingCart/migrations/__pycache__/0001_initial.cpython-37.pyc b/EDMS/shoppingCart/migrations/__pycache__/0001_initial.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..385264f026a1eb1248d19826dbb94c4c3f117e82 GIT binary patch literal 1475 zcmZux&2HO95azE$NtEr_a(>$MQskln7Tik$1Vs@?l3Sy;Q&jea5J0TBW0^F`Wp`Ii z^ynHiX-maWvv?7+^Pz$tY*b%Vw?26d?Wt3h3`ljbjW(4_Xn=r=x~ zztK09CqT+LpNqbw+F3m3M8+%^s*y1YsW^@FzSY=7;T8UZn}z{KU{WKns2SMcymO(E zG~b(ZGw{GkTGXO8w37}s@xu&g@x&s&%p|(V6mw3n5tsTv;(a zRMyd`?Et`P+ z9Hx-ZuC_KVVo0e_?i)@q zJ1=5cq4)G{zN6Qh6fVdjl@*2;)yKHr6_>0iuo;Jh%fZU5n%{Fq7m-vho+bj-Dq)W# zWXk(-L2?<(rEW+=xl9MV-u?)uw5euMfn4`KTCA<7{m04+OE$t#wZjm*e~|*pei&km zR5OHHGtOg)9CBNS>xs9dD98*qQYav&kVi{y>7~ts^RsWm^U3&!@Z`;Ce60N29We;i z8I}b)(RYmNJFQv=ShqvXn`#X&39rQVSW{oihm1o!&%eV`HfTcfIa3y$DX%O5URu>0 z9!!P@qp|W|GnN9$D@SiKJ_}FJkB?RRFl9tmR{toMFo#tjRzQ9A|1kJ-%&46Hc{_YL zJ;%C>De}x=Is$PeSuq`JQueSg2}H8iMzN4Qo-OnPvWIyieopcT_QX%aq{1bNWO*|~aGE&5b`Cvo0*?Iv z&YbuqUpes$oEWFODr3!PX5M7R^PE>lM>!*T{Nua$88P-d1P4jTIVH7^$N+<=WnEN6 zU0lQwd&3|G{*3|0sNr9E!6CU~tMm`mvQ_N!PSr*_)obf#T@TpWDnJLx$T=mo8#2g> z2v`wAR7VBJq)9__oHcVu=%g^a)9rb+X3yo~^h~cdgXdKG9>_`o%c3y#(QULh|XZLdy;b4mSO$u!T#S znTaVcgwKVby0Jy_mqL6VWgBWk1UR4u)RjVOVp`5;F9BYM9)^c7e;e*GC4AlwxM%4X zGY<)#%-=6(&&m%LjV+~i2FoqlYu69ud6=|*XZi*!w~w~UI-_=D;CkIjr5$RiD_q+f z>#!@&w-;CC{{)ryPg4?APsN@gF%fh!+?eq4Gg2FVj*QQeB#P-w`O8(}7tlyu_b0HM cHk|gF!21>Mykq*_XV34rdJ)#QfszOOA3YedUjP6A literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/migrations/__pycache__/0003_auto_20201012_1250.cpython-37.pyc b/EDMS/shoppingCart/migrations/__pycache__/0003_auto_20201012_1250.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4561bf0d08907189b617a6d9916dec87e8b1aeb2 GIT binary patch literal 836 zcmYjPO>fgc5cPK)H=z~c00+1SsgWDRr9!A7N#Q_SMB0mGY2{?6!LGe)cGp6=@^S1B z;08zj(q1|77dSENG%aK8Xm)ni^WMCD)$d0Z+SBjfh;S_Hx7lpX!{7*)JVZw=YL`}J zC$?>3r*tYeaVszJ+Pz!)N$}dD9`(Ok)Cafdd~uTwb?4R~_=ESYfvrOcO66=N2ab-a zd?hlKb0&3AaSEk8U7EVBbul=?C6Cd8mDtou9B_Yl;1|J9o7yWU>0qCbI@E=35n*o+ zc8XrnE&9bhQ$_u2j|SK7%1(A^2a$xjd$Mhd7<%#puWJM}$%IPo$8kI&wcxZ_Dw0>( z3Us(^q~a9_?KKj_`M}fuqRiNp_E=Mvy2}|s=%7G5iVs|*WvCFARe&YN`uiDN6l!1;*m7;;vGnfv;`|M{n9tsm zle6jUt?u1c|_$fMijaP#bj+c}7bhOp^#M|~4L!JH0XY&3gm NG?D?jp1o&>?mxGZ@QVNd literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/migrations/__pycache__/__init__.cpython-37.pyc b/EDMS/shoppingCart/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3749c744383d660526f9402238493c4993d30510 GIT binary patch literal 202 zcmZ?b<>g`k0?@gVv!h=2h`Aj1KOi&=m~3PUi1CZpdI zlbBahlp5obTAW>yUl8M3Selrl8&H&=m6}`v<+)@QmlS0tm6l}Y=jrAqX6BWo<|XDO zr|K407MG;v#<;rp2FDa<#K&jmWtPOp>lIYq;;_lh QPbtkwwF5ckGY~TX00S~Q9smFU literal 0 HcmV?d00001 diff --git a/EDMS/shoppingCart/models.py b/EDMS/shoppingCart/models.py index 708d2a8..753214f 100644 --- a/EDMS/shoppingCart/models.py +++ b/EDMS/shoppingCart/models.py @@ -31,6 +31,18 @@ class OrderItem(models.Model): order = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True) quantity = models.IntegerField(default=0, null=True, blank=True) +class ID(models.Model): + ID_Cus = models.CharField(max_length=200, null=True) + + +class DeliveriesSlots(models.Model): + TimeSlot1= models.CharField(max_length=200, null=True) + TimeSlot2= models.CharField(max_length=200, null=True) + TimeSlot3= models.CharField(max_length=200, null=True) + TimeSlot4= models.CharField(max_length=200, null=True) + + + def __str__(self): return self.product.name diff --git a/EDMS/shoppingCart/templates/shoppingCart/deliveries.html b/EDMS/shoppingCart/templates/shoppingCart/deliveries.html new file mode 100644 index 0000000..4a7400b --- /dev/null +++ b/EDMS/shoppingCart/templates/shoppingCart/deliveries.html @@ -0,0 +1,90 @@ +{% include 'shoppingCart/main.html' %} +{%load static%} + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + +
+
+ Time Slot 1 + + Time slot 2 + + Time slot 3 + + Time slot 4 + +
+ +
+ Monday + + +
+
+ Tuesday +
+
+ Wednesday +
+
+ Thursday +
+
+ Friday +
+
+ Saturday +
+
+ Sunday +
+ + + + + +
+ + + + +
+ + + + + + + + \ No newline at end of file diff --git a/EDMS/shoppingCart/templates/shoppingCart/main.html b/EDMS/shoppingCart/templates/shoppingCart/main.html index 33bfb28..27cddcf 100755 --- a/EDMS/shoppingCart/templates/shoppingCart/main.html +++ b/EDMS/shoppingCart/templates/shoppingCart/main.html @@ -14,6 +14,7 @@ + @@ -58,8 +59,8 @@ diff --git a/EDMS/shoppingCart/urls.py b/EDMS/shoppingCart/urls.py index f769612..558de13 100644 --- a/EDMS/shoppingCart/urls.py +++ b/EDMS/shoppingCart/urls.py @@ -3,7 +3,8 @@ from django.urls import path urlpatterns = [ - path('', views.main, name="main"), + path('main/', views.main, name="main"), path('updateItem/', views.updateItem, name="updateItem"), + path('delivery/', views.delivery) ] diff --git a/EDMS/shoppingCart/views.py b/EDMS/shoppingCart/views.py index db35600..0d151ed 100644 --- a/EDMS/shoppingCart/views.py +++ b/EDMS/shoppingCart/views.py @@ -18,6 +18,9 @@ def main(request): return render(request,'shoppingCart/main.html', context) +def delivery(request): + return render(request,'shoppingCart/deliveries.html') + #Updateitem view def updateItem(request): data = json.loads(request.body) @@ -43,4 +46,6 @@ def updateItem(request): orderItem.delete() print('ProductID: ', productId, 'Action:',action) - return JsonResponse('item added', safe=False) \ No newline at end of file + return JsonResponse('item added', safe=False) + + diff --git a/EDMS/static/css/style.css b/EDMS/static/css/style.css index 58de862..2dcd787 100755 --- a/EDMS/static/css/style.css +++ b/EDMS/static/css/style.css @@ -78,6 +78,16 @@ h6 { font-size: 16px; } + +form1 + { + font-size: 120px; + position: relative; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + } p { font-size: 16px; font-family: "Cairo", sans-serif; @@ -116,6 +126,7 @@ ol { Helper CSS -----------------------*/ + .section-title { margin-bottom: 50px; text-align: center; From 2a67fa248bc91b00312607df9bdd3250e8f40367 Mon Sep 17 00:00:00 2001 From: efstathioa Date: Sun, 18 Oct 2020 06:20:48 +0100 Subject: [PATCH 07/14] Databases and some design --- EDMS/shoppingCart/templates/shoppingCart/deliveries.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EDMS/shoppingCart/templates/shoppingCart/deliveries.html b/EDMS/shoppingCart/templates/shoppingCart/deliveries.html index 4a7400b..90e3d88 100644 --- a/EDMS/shoppingCart/templates/shoppingCart/deliveries.html +++ b/EDMS/shoppingCart/templates/shoppingCart/deliveries.html @@ -11,7 +11,7 @@
- +
From 9edcadbd0c8a74e177849e357ef93fc309d63f95 Mon Sep 17 00:00:00 2001 From: Nour Elgeziry Date: Sun, 18 Oct 2020 22:15:08 +0100 Subject: [PATCH 08/14] basket refreshes automaticaly every 2 minutes --- .DS_Store | Bin 6148 -> 6148 bytes EDMS/EDMS/__init__.py | 5 ++ EDMS/EDMS/celery.py | 21 +++++ EDMS/EDMS/settings.py | 13 +-- EDMS/db.sqlite3 | Bin 176128 -> 188416 bytes EDMS/shoppingCart/admin.py | 1 + EDMS/shoppingCart/cron.py | 19 ---- EDMS/shoppingCart/migrations/0005_test.py | 20 +++++ .../migrations/0006_auto_20201018_1229.py | 26 ++++++ .../migrations/0007_auto_20201018_1316.py | 28 ++++++ .../migrations/0008_auto_20201018_1342.py | 29 ++++++ .../migrations/0009_auto_20201018_1354.py | 23 +++++ .../migrations/0010_auto_20201018_1401.py | 22 +++++ .../migrations/0011_order_complete.py | 18 ++++ .../migrations/0012_auto_20201018_1430.py | 19 ++++ .../migrations/0013_auto_20201018_1439.py | 19 ++++ .../migrations/0014_auto_20201018_1443.py | 21 +++++ .../migrations/0015_auto_20201018_1448.py | 27 ++++++ .../migrations/0016_auto_20201018_1456.py | 27 ++++++ .../migrations/0017_order_orderitem.py | 38 ++++++++ .../migrations/0018_auto_20201018_1522.py | 24 +++++ .../migrations/0019_auto_20201018_1759.py | 31 +++++++ .../migrations/0020_auto_20201018_2051.py | 20 +++++ .../migrations/0021_auto_20201018_2056.py | 19 ++++ EDMS/shoppingCart/models.py | 21 ++--- EDMS/shoppingCart/urls.py | 1 + EDMS/shoppingCart/views.py | 40 +++++++-- EDMS/static/js/cart.js | 2 +- Pipfile | 1 + Pipfile.lock | 85 +++++++++++++++++- 30 files changed, 575 insertions(+), 45 deletions(-) create mode 100644 EDMS/EDMS/celery.py delete mode 100644 EDMS/shoppingCart/cron.py create mode 100644 EDMS/shoppingCart/migrations/0005_test.py create mode 100644 EDMS/shoppingCart/migrations/0006_auto_20201018_1229.py create mode 100644 EDMS/shoppingCart/migrations/0007_auto_20201018_1316.py create mode 100644 EDMS/shoppingCart/migrations/0008_auto_20201018_1342.py create mode 100644 EDMS/shoppingCart/migrations/0009_auto_20201018_1354.py create mode 100644 EDMS/shoppingCart/migrations/0010_auto_20201018_1401.py create mode 100644 EDMS/shoppingCart/migrations/0011_order_complete.py create mode 100644 EDMS/shoppingCart/migrations/0012_auto_20201018_1430.py create mode 100644 EDMS/shoppingCart/migrations/0013_auto_20201018_1439.py create mode 100644 EDMS/shoppingCart/migrations/0014_auto_20201018_1443.py create mode 100644 EDMS/shoppingCart/migrations/0015_auto_20201018_1448.py create mode 100644 EDMS/shoppingCart/migrations/0016_auto_20201018_1456.py create mode 100644 EDMS/shoppingCart/migrations/0017_order_orderitem.py create mode 100644 EDMS/shoppingCart/migrations/0018_auto_20201018_1522.py create mode 100644 EDMS/shoppingCart/migrations/0019_auto_20201018_1759.py create mode 100644 EDMS/shoppingCart/migrations/0020_auto_20201018_2051.py create mode 100644 EDMS/shoppingCart/migrations/0021_auto_20201018_2056.py diff --git a/.DS_Store b/.DS_Store index c10ec4f00dff4f9523e59f9c56fe64d8efcafc46..dc5052e198cef2cbe9bb1ba3a30caee6d0d21248 100644 GIT binary patch literal 6148 zcmeHKF>ezw6n<_)a|u*LZKZa+1&JX-7YY;!Azec;&1OuQpmkY^>%Q?zj8kG>p z!Vf@Vpk-lY<2SJJ3z+#4h!NhiO%z`!V?~jlWPi5bd-n5ZpM3@ZRviQtfD!;$mE#xr!*%Es$~_CQ6Eve;x&1L z_pyx*gZlU5&)d2__^ZCxnK>JlKcOq+aoht)pa~oTXlbJZyqdSj#PH+ok%%GFPnTo;VUjw|SGKU2JGYd# ztfEz1ENrhzG(zTrb<3&dqVz9&K$oW&7IZjq$i(tzW9#-r4US zJ|DdpzdRCC0EP#)kc$d`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~u zid{NIL*V;MM0A4I+c#wTvc28gx_zFmOs1FZo}g(= expiry_date: - #set expired field to true - item.expired = True - # delete order item - item.delete() \ No newline at end of file diff --git a/EDMS/shoppingCart/migrations/0005_test.py b/EDMS/shoppingCart/migrations/0005_test.py new file mode 100644 index 0000000..645b4d2 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0005_test.py @@ -0,0 +1,20 @@ +# Generated by Django 3.1.2 on 2020-10-16 14:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0004_auto_20201016_1152'), + ] + + operations = [ + migrations.CreateModel( + name='Test', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=4)), + ], + ), + ] diff --git a/EDMS/shoppingCart/migrations/0006_auto_20201018_1229.py b/EDMS/shoppingCart/migrations/0006_auto_20201018_1229.py new file mode 100644 index 0000000..7277723 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0006_auto_20201018_1229.py @@ -0,0 +1,26 @@ +# Generated by Django 3.1.2 on 2020-10-18 12:29 + +import datetime +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0005_test'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='date_created', + field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), + preserve_default=False, + ), + migrations.AddField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 12, 30, 18, 872950)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0007_auto_20201018_1316.py b/EDMS/shoppingCart/migrations/0007_auto_20201018_1316.py new file mode 100644 index 0000000..ba38b4a --- /dev/null +++ b/EDMS/shoppingCart/migrations/0007_auto_20201018_1316.py @@ -0,0 +1,28 @@ +# Generated by Django 3.1.2 on 2020-10-18 13:16 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0006_auto_20201018_1229'), + ] + + operations = [ + migrations.RemoveField( + model_name='orderitem', + name='expired', + ), + migrations.AddField( + model_name='order', + name='expired', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 13, 17, 6, 8469)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0008_auto_20201018_1342.py b/EDMS/shoppingCart/migrations/0008_auto_20201018_1342.py new file mode 100644 index 0000000..2862aec --- /dev/null +++ b/EDMS/shoppingCart/migrations/0008_auto_20201018_1342.py @@ -0,0 +1,29 @@ +# Generated by Django 3.1.2 on 2020-10-18 13:42 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0007_auto_20201018_1316'), + ] + + operations = [ + migrations.AddField( + model_name='orderitem', + name='expired', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='order', + name='date_created', + field=models.DateTimeField(verbose_name=datetime.datetime(2020, 10, 18, 13, 42, 9, 885618)), + ), + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 13, 43, 9, 885636)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0009_auto_20201018_1354.py b/EDMS/shoppingCart/migrations/0009_auto_20201018_1354.py new file mode 100644 index 0000000..0e60faf --- /dev/null +++ b/EDMS/shoppingCart/migrations/0009_auto_20201018_1354.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.2 on 2020-10-18 13:54 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0008_auto_20201018_1342'), + ] + + operations = [ + migrations.RemoveField( + model_name='order', + name='date_created', + ), + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 13, 55, 33, 184566)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0010_auto_20201018_1401.py b/EDMS/shoppingCart/migrations/0010_auto_20201018_1401.py new file mode 100644 index 0000000..5d6f795 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0010_auto_20201018_1401.py @@ -0,0 +1,22 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0009_auto_20201018_1354'), + ] + + operations = [ + migrations.RemoveField( + model_name='order', + name='complete', + ), + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateField(), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0011_order_complete.py b/EDMS/shoppingCart/migrations/0011_order_complete.py new file mode 100644 index 0000000..c67ab7f --- /dev/null +++ b/EDMS/shoppingCart/migrations/0011_order_complete.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0010_auto_20201018_1401'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='complete', + field=models.BooleanField(default=False), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0012_auto_20201018_1430.py b/EDMS/shoppingCart/migrations/0012_auto_20201018_1430.py new file mode 100644 index 0000000..ae676dd --- /dev/null +++ b/EDMS/shoppingCart/migrations/0012_auto_20201018_1430.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:30 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0011_order_complete'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(verbose_name=datetime.date(2020, 10, 25)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0013_auto_20201018_1439.py b/EDMS/shoppingCart/migrations/0013_auto_20201018_1439.py new file mode 100644 index 0000000..e712115 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0013_auto_20201018_1439.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:39 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0012_auto_20201018_1430'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(null=True, verbose_name=datetime.date(2020, 10, 25)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0014_auto_20201018_1443.py b/EDMS/shoppingCart/migrations/0014_auto_20201018_1443.py new file mode 100644 index 0000000..f4aaeb4 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0014_auto_20201018_1443.py @@ -0,0 +1,21 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:43 + +import datetime +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0013_auto_20201018_1439'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(default=django.utils.timezone.now, verbose_name=datetime.date(2020, 10, 25)), + preserve_default=False, + ), + ] diff --git a/EDMS/shoppingCart/migrations/0015_auto_20201018_1448.py b/EDMS/shoppingCart/migrations/0015_auto_20201018_1448.py new file mode 100644 index 0000000..78ebe02 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0015_auto_20201018_1448.py @@ -0,0 +1,27 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:48 + +import datetime +from django.db import migrations, models +import django.utils.timezone +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0014_auto_20201018_1443'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='date_created', + field=models.DateTimeField(default=django.utils.timezone.now, verbose_name=datetime.datetime(2020, 10, 18, 14, 47, 51, 354484, tzinfo=utc)), + preserve_default=False, + ), + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(verbose_name=datetime.datetime(2020, 10, 25, 14, 47, 51, 354511, tzinfo=utc)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0016_auto_20201018_1456.py b/EDMS/shoppingCart/migrations/0016_auto_20201018_1456.py new file mode 100644 index 0000000..04fe58a --- /dev/null +++ b/EDMS/shoppingCart/migrations/0016_auto_20201018_1456.py @@ -0,0 +1,27 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0015_auto_20201018_1448'), + ] + + operations = [ + migrations.RemoveField( + model_name='orderitem', + name='order', + ), + migrations.RemoveField( + model_name='orderitem', + name='product', + ), + migrations.DeleteModel( + name='Order', + ), + migrations.DeleteModel( + name='OrderItem', + ), + ] diff --git a/EDMS/shoppingCart/migrations/0017_order_orderitem.py b/EDMS/shoppingCart/migrations/0017_order_orderitem.py new file mode 100644 index 0000000..66c1195 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0017_order_orderitem.py @@ -0,0 +1,38 @@ +# Generated by Django 3.1.2 on 2020-10-18 14:57 + +import datetime +from django.db import migrations, models +import django.db.models.deletion +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0016_auto_20201018_1456'), + ] + + operations = [ + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date_created', models.DateTimeField(verbose_name=datetime.datetime(2020, 10, 18, 14, 57, 32, 274339, tzinfo=utc))), + ('expiry_date', models.DateTimeField(verbose_name=datetime.datetime(2020, 10, 25, 14, 57, 32, 274372, tzinfo=utc))), + ('expired', models.BooleanField(default=False)), + ('complete', models.BooleanField(default=False)), + ('customer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.customer')), + ], + ), + migrations.CreateModel( + name='OrderItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('quantity', models.IntegerField(blank=True, default=0, null=True)), + ('date_created', models.DateTimeField(auto_now_add=True)), + ('expired', models.BooleanField(default=False)), + ('order', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.order')), + ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='shoppingCart.product')), + ], + ), + ] diff --git a/EDMS/shoppingCart/migrations/0018_auto_20201018_1522.py b/EDMS/shoppingCart/migrations/0018_auto_20201018_1522.py new file mode 100644 index 0000000..67f9b83 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0018_auto_20201018_1522.py @@ -0,0 +1,24 @@ +# Generated by Django 3.1.2 on 2020-10-18 15:22 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0017_order_orderitem'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='date_created', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 15, 22, 1, 700384)), + ), + migrations.AlterField( + model_name='order', + name='expiry_date', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 15, 24, 1, 700420)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0019_auto_20201018_1759.py b/EDMS/shoppingCart/migrations/0019_auto_20201018_1759.py new file mode 100644 index 0000000..95192db --- /dev/null +++ b/EDMS/shoppingCart/migrations/0019_auto_20201018_1759.py @@ -0,0 +1,31 @@ +# Generated by Django 3.1.2 on 2020-10-18 17:59 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0018_auto_20201018_1522'), + ] + + operations = [ + migrations.RemoveField( + model_name='order', + name='expiry_date', + ), + migrations.RemoveField( + model_name='orderitem', + name='date_created', + ), + migrations.RemoveField( + model_name='orderitem', + name='expired', + ), + migrations.AlterField( + model_name='order', + name='date_created', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 17, 59, 41, 21325)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0020_auto_20201018_2051.py b/EDMS/shoppingCart/migrations/0020_auto_20201018_2051.py new file mode 100644 index 0000000..87043e8 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0020_auto_20201018_2051.py @@ -0,0 +1,20 @@ +# Generated by Django 3.1.2 on 2020-10-18 20:51 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0019_auto_20201018_1759'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='date_created', + field=models.DateTimeField(default=datetime.datetime(2020, 10, 18, 20, 51, 23, 928323, tzinfo=utc)), + ), + ] diff --git a/EDMS/shoppingCart/migrations/0021_auto_20201018_2056.py b/EDMS/shoppingCart/migrations/0021_auto_20201018_2056.py new file mode 100644 index 0000000..84dc0f8 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0021_auto_20201018_2056.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.2 on 2020-10-18 20:56 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0020_auto_20201018_2051'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='date_created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/EDMS/shoppingCart/models.py b/EDMS/shoppingCart/models.py index 42573f7..94f4452 100644 --- a/EDMS/shoppingCart/models.py +++ b/EDMS/shoppingCart/models.py @@ -1,9 +1,15 @@ from django.db import models from django.contrib.auth.models import User +from datetime import datetime, timedelta +from django.utils import timezone + # Create your models here. +class Test(models.Model): + name = models.CharField(max_length=4) + class Customer(models.Model): user = models.OneToOneField(User, on_delete =models.CASCADE, null=True, blank=True) name = models.CharField(max_length=200, null=True) @@ -22,9 +28,10 @@ class Product(models.Model): class Order(models.Model): customer = models.ForeignKey(Customer, on_delete = models.SET_NULL, blank=True, null=True) - complete = models.BooleanField(default=False, null=True, blank=True) + date_created = models.DateTimeField(default = timezone.now) + expired = models.BooleanField(default=False) + complete = models.BooleanField(default=False) - def __str__ (self): return str(self.id) @@ -32,13 +39,7 @@ class OrderItem(models.Model): product = models.ForeignKey(Product, on_delete=models.SET_NULL, blank=True, null=True) order = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True) quantity = models.IntegerField(default=0, null=True, blank=True) - date_created = models.DateTimeField(auto_now_add=True) - expired = models.BooleanField(default=False) - + def __str__(self): return self.product.name - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/EDMS/shoppingCart/urls.py b/EDMS/shoppingCart/urls.py index 1eb81d2..337689d 100644 --- a/EDMS/shoppingCart/urls.py +++ b/EDMS/shoppingCart/urls.py @@ -5,6 +5,7 @@ from django.urls import path urlpatterns = [ path('', views.main, name="main"), path('updateItem/', views.updateItem, name="updateItem"), + ] diff --git a/EDMS/shoppingCart/views.py b/EDMS/shoppingCart/views.py index fb641b8..7357d78 100644 --- a/EDMS/shoppingCart/views.py +++ b/EDMS/shoppingCart/views.py @@ -1,19 +1,46 @@ from django.shortcuts import render +from django.views import View from .models import * # Create your views here. -from django.http.response import JsonResponse +from django.http.response import JsonResponse, HttpResponse import json -from django.contrib import messages +import pytz # main page def main(request): + customer = Customer.objects.get(id=1) + products = Product.objects.all() order, created = Order.objects.get_or_create(customer=customer, complete= False) - customerOrderItem = order.orderitem_set.all() - products = Product.objects.all() + customerOrderItem = order.orderitem_set.all() + + #start time for order expiry + utc = pytz.UTC + print('date_Created:' + str(order.date_created)) + + expiry_time = timedelta(minutes=2) + print('expiry time' + str(expiry_time)) + + expiry_date = order.date_created + expiry_time + print('expiry_date:' + str(expiry_date)) + + date_now = utc.localize(datetime.now()) + print('date now:' + str(date_now)) + #check if expiry date is reached + if date_now >= expiry_date: + order.expired= True + order.save() + + #check if order is expired + if order.expired == True: + order.delete() + for item in customerOrderItem: + item.delete() + Order.objects.create(customer=customer, complete= False) + context = {'customer':customer, 'order':order, 'customerOrderItem':customerOrderItem, 'products':products} return render(request,'shoppingCart/main.html', context) @@ -26,11 +53,9 @@ def updateItem(request): customer = request.user.customer product = Product.objects.get(id=productId) - order, created = Order.objects.get_or_create(customer=customer,complete=False) + order, created = Order.objects.get_or_create(customer=customer, complete= False) orderItem, created = OrderItem.objects.get_or_create(order=order, product=product) - #query order that did not expire - #querry orderitems in the order #make sure the quantity does not exceed 9 if orderItem.quantity >= 9 : @@ -49,4 +74,3 @@ def updateItem(request): print('ProductID: ', productId, 'Action:',action) return JsonResponse('item added', safe=False) - diff --git a/EDMS/static/js/cart.js b/EDMS/static/js/cart.js index ffdfa10..7f8d110 100644 --- a/EDMS/static/js/cart.js +++ b/EDMS/static/js/cart.js @@ -18,7 +18,7 @@ for (i = 0; i < updateButton.length; i++) { function updateUserOrder(productId, action) { - var url = '/updateItem/' + var url = '/main_class/' fetch(url, { method: 'POST', diff --git a/Pipfile b/Pipfile index 7a8362b..e3bc28f 100644 --- a/Pipfile +++ b/Pipfile @@ -9,6 +9,7 @@ verify_ssl = true django = "*" pillow = "*" django-crontab = "*" +celery = "*" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 0301188..a146a7d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "292744283c56cc32f20b13692b19ffe1958359200bfe6539399352866167da4e" + "sha256": "d9d9a412445aee8a1e4ebb76250dda9d583b4ccd098608581d3a31152a3dfc3c" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,14 @@ ] }, "default": { + "amqp": { + "hashes": [ + "sha256:9881f8e6fe23e3db9faa6cfd8c05390213e1d1b95c0162bc50552cad75bffa5f", + "sha256:a8fb8151eb9d12204c9f1784c0da920476077609fa0a70f2468001e3a4258484" + ], + "markers": "python_version >= '3.6'", + "version": "==5.0.1" + }, "asgiref": { "hashes": [ "sha256:7e51911ee147dd685c3c8b805c0ad0cb58d360987b56953878f8c06d2d1c6f1a", @@ -24,6 +32,42 @@ "markers": "python_version >= '3.5'", "version": "==3.2.10" }, + "billiard": { + "hashes": [ + "sha256:bff575450859a6e0fbc2f9877d9b715b0bbc07c3565bb7ed2280526a0cdf5ede", + "sha256:d91725ce6425f33a97dfa72fb6bfef0e47d4652acd98a032bd1a7fbf06d5fa6a" + ], + "version": "==3.6.3.0" + }, + "celery": { + "hashes": [ + "sha256:313930fddde703d8e37029a304bf91429cd11aeef63c57de6daca9d958e1f255", + "sha256:72138dc3887f68dc58e1a2397e477256f80f1894c69fa4337f8ed70be460375b" + ], + "index": "pypi", + "version": "==5.0.0" + }, + "click": { + "hashes": [ + "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a", + "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==7.1.2" + }, + "click-didyoumean": { + "hashes": [ + "sha256:112229485c9704ff51362fe34b2d4f0b12fc71cc20f6d2b3afabed4b8bfa6aeb" + ], + "version": "==0.0.3" + }, + "click-repl": { + "hashes": [ + "sha256:9c4c3d022789cae912aad8a3f5e1d7c2cdd016ee1225b5212ad3e8691563cda5", + "sha256:b9f29d52abc4d6059f8e276132a111ab8d94980afe6a5432b9d996544afa95d5" + ], + "version": "==0.1.6" + }, "django": { "hashes": [ "sha256:a2127ad0150ec6966655bedf15dbbff9697cc86d61653db2da1afa506c0b04cc", @@ -39,6 +83,14 @@ "index": "pypi", "version": "==0.7.1" }, + "kombu": { + "hashes": [ + "sha256:6dc509178ac4269b0e66ab4881f70a2035c33d3a622e20585f965986a5182006", + "sha256:f4965fba0a4718d47d470beeb5d6446e3357a62402b16c510b6a2f251e05ac3c" + ], + "markers": "python_version >= '3.6'", + "version": "==5.0.2" + }, "pillow": { "hashes": [ "sha256:04d984e45a0b9815f4b407e8aadb50f25fbb82a605d89db927376e94c3adf371", @@ -74,6 +126,14 @@ "index": "pypi", "version": "==8.0.0" }, + "prompt-toolkit": { + "hashes": [ + "sha256:25c95d2ac813909f813c93fde734b6e44406d1477a9faef7c915ff37d39c0a8c", + "sha256:7debb9a521e0b1ee7d2fe96ee4bd60ef03c6492784de0547337ca4433e46aa63" + ], + "markers": "python_full_version >= '3.6.1'", + "version": "==3.0.8" + }, "pytz": { "hashes": [ "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed", @@ -81,6 +141,14 @@ ], "version": "==2020.1" }, + "six": { + "hashes": [ + "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", + "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.15.0" + }, "sqlparse": { "hashes": [ "sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0", @@ -88,6 +156,21 @@ ], "markers": "python_version >= '3.5'", "version": "==0.4.1" + }, + "vine": { + "hashes": [ + "sha256:4c9dceab6f76ed92105027c49c823800dd33cacce13bdedc5b914e3514b7fb30", + "sha256:7d3b1624a953da82ef63462013bbd271d3eb75751489f9807598e8f340bd637e" + ], + "markers": "python_version >= '3.6'", + "version": "==5.0.0" + }, + "wcwidth": { + "hashes": [ + "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784", + "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" + ], + "version": "==0.2.5" } }, "develop": {} From 713c49673c0a82b3d0ef5fddd80c5548c11844a5 Mon Sep 17 00:00:00 2001 From: efstathioa Date: Mon, 19 Oct 2020 14:07:14 +0100 Subject: [PATCH 09/14] databases and design --- EDMS/db.sqlite3 | Bin 180224 -> 180224 bytes .../templates/shoppingCart/deliveries.html | 140 ++++++++++----- .../templates/shoppingCart/main.html | 75 +------- .../templates/shoppingCart/nav.html | 74 ++++++++ EDMS/shoppingCart/urls.py | 2 +- EDMS/shoppingCart/views.py | 6 +- EDMS/static/css/main.css | 162 ++++++++++++++++++ EDMS/static/css/style.css | 11 +- 8 files changed, 345 insertions(+), 125 deletions(-) create mode 100644 EDMS/shoppingCart/templates/shoppingCart/nav.html create mode 100644 EDMS/static/css/main.css diff --git a/EDMS/db.sqlite3 b/EDMS/db.sqlite3 index b0882eccc90af9319480595ed2001e6d7d922232..202a5720fdd0dfbcc705e4f5d7c6464e1f96c8c2 100644 GIT binary patch delta 375 zcmZo@;BIK(o*>1<=sr=#2}o{C_^roiI5|eYhmocErT+Gp`i#;A%!Yior?W3$3>M&f z$j{36pYJE%XTG<5&-rd|Rx~K&6Jlj%WaKskkz58~w*L0F>lnounGN}Qrn7HgjAi2& z;}_)T0jgfa$Irsd$!G{73_yhbbm{$!FPROQw5PKl0IFnK!<5IQz1dOVAY;9wAt!?) zzq&RfC#R8tk%6uu5Lqf18d;f|SQ(n?nOT|}8XB5-x+vr)Wu+#UC}@~yMpr8(rlh2% zC|M~~*Ve{z+Zce1FcoCvWJEQ>1Zaero}rnEp}Dz1 - +
+
- +
- +
- +
-
-
+
-
+
+ +

+ Yes + + + No +

+ +
+ + -
-
- Time Slot 1 + - Time slot 2 - Time slot 3 - Time slot 4 + + +
--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MondayTuesdayWednesdayThursdayFridaySaturdaySunday
AvailableAvailableAvailableAvailableAvailableAvailableAvailable
AvailableAvailableAvailableAvailableAvailableAvailableAvailable
AvailableAvailableAvailableAvailableAvailableAvailableAvailable
AvailableAvailableAvailableAvailableAvailableAvailableAvailable
-
+ + - -
- \ No newline at end of file diff --git a/EDMS/shoppingCart/templates/shoppingCart/main.html b/EDMS/shoppingCart/templates/shoppingCart/main.html index 27cddcf..73db15a 100755 --- a/EDMS/shoppingCart/templates/shoppingCart/main.html +++ b/EDMS/shoppingCart/templates/shoppingCart/main.html @@ -1,76 +1,9 @@ +{%include 'shoppingCart/nav.html' %} {%load static%} - - - - - - - Limit Items bought per Week - - - - - - - - - - - - - - - - - - - - -
- -
+
@@ -94,7 +27,7 @@ Week's Basket @@ -129,7 +62,7 @@
- + diff --git a/EDMS/shoppingCart/templates/shoppingCart/nav.html b/EDMS/shoppingCart/templates/shoppingCart/nav.html new file mode 100644 index 0000000..9c68c40 --- /dev/null +++ b/EDMS/shoppingCart/templates/shoppingCart/nav.html @@ -0,0 +1,74 @@ +{%load static%} + + + + + + + + + + Limit Items bought per Week + + + + + + + + + + + + + + + + + + + + + +
+ +
\ No newline at end of file diff --git a/EDMS/shoppingCart/urls.py b/EDMS/shoppingCart/urls.py index 558de13..2f6f0e0 100644 --- a/EDMS/shoppingCart/urls.py +++ b/EDMS/shoppingCart/urls.py @@ -3,7 +3,7 @@ from django.urls import path urlpatterns = [ - path('main/', views.main, name="main"), + path('', views.main, name="main"), path('updateItem/', views.updateItem, name="updateItem"), path('delivery/', views.delivery) ] diff --git a/EDMS/shoppingCart/views.py b/EDMS/shoppingCart/views.py index 0d151ed..4f9a74e 100644 --- a/EDMS/shoppingCart/views.py +++ b/EDMS/shoppingCart/views.py @@ -17,7 +17,7 @@ def main(request): context = {'customer':customer, 'order':order, 'customerOrderItem':customerOrderItem, 'products':products} return render(request,'shoppingCart/main.html', context) - +#Delivery Page def delivery(request): return render(request,'shoppingCart/deliveries.html') @@ -45,6 +45,10 @@ def updateItem(request): if orderItem.quantity <= 0: orderItem.delete() + + + + print('ProductID: ', productId, 'Action:',action) return JsonResponse('item added', safe=False) diff --git a/EDMS/static/css/main.css b/EDMS/static/css/main.css new file mode 100644 index 0000000..9413cef --- /dev/null +++ b/EDMS/static/css/main.css @@ -0,0 +1,162 @@ +#submit{ + position: relative; + left:5%; + +} +#submit:active{ + background-color: #7fad39; + color: black; +} + + +#wrapper +{ + + display: inline-block; + padding:20px; + position: relative; +} + +h7 { +font-size: 20px; +; + + +} +h8:hover { + margin-bottom: 10px; + background-color: #7fad39; +} + + +h11{ + font-size: 20px; + visibility: hidden; + +} + +#timeslots +{ + top:40px; + width: 100%!important; +} + +h9{ + +position: relative; + +display: inline-block; + +} + +h10{ + + font-size: 20px; + +} + +#container1{ + + position: relative; + display: inline-block; + width:75%; + right:100px; + bottom: 100px; +} +#form1{ + position: relative; + margin-left:auto; + width: 10%; + right:1%; +} +.col-sm { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + height: 50%; +} + +button { + background: #ededed; + border: 1px solid #ccc; + border-radius: 3px; + cursor: pointer; + margin-left: auto!important; + margin-right: auto!important; + } + + button:active { + background-color: #656565; + color: #7fad39; + -webkit-box-shadow: inset 0px 0px 5px #c1c1c1; + -moz-box-shadow: inset 0px 0px 5px #c1c1c1; + box-shadow: inset 0px 0px 5px #c1c1c1; + + + } + + + .button { + display: inline-block; + border-radius: 4px; + background-color: #7fad39; + border: none; + color: #FFFFFF; + text-align: center; + font-size: 20px; + width: 10%; + height: 10%; + transition: all 0.2s; + cursor: pointer; + margin: 0; + position: relative; + left: 50%; + right: 50%; + + } + + .button span { + cursor: pointer; + display: inline-block; + position: relative; + transition: 0.2s; + } + + .button span:after { + content: '\00bb'; + position: absolute; + opacity: 0; + top: 0; + right: -20px; + transition: 0.5s; + } + + .button:hover span { + padding-right: 25px; + } + + .button:hover span:after { + opacity: 1; + right: 0; + } + + + + table { + border-collapse: collapse; + width: 75%; + margin-left:auto; + margin-right:auto; + position: relative; + bottom: 20%; + } + + th, td { + padding: 8px; + text-align: left; + border-bottom: 1px solid #ddd; + } + + tr:hover {background-color:lightgray;} diff --git a/EDMS/static/css/style.css b/EDMS/static/css/style.css index 2dcd787..c87fcae 100755 --- a/EDMS/static/css/style.css +++ b/EDMS/static/css/style.css @@ -79,15 +79,8 @@ h6 { } -form1 - { - font-size: 120px; - position: relative; - top: 50%; - -webkit-transform: translateY(-50%); - -ms-transform: translateY(-50%); - transform: translateY(-50%); - } + + p { font-size: 16px; font-family: "Cairo", sans-serif; From 70aad0d364934772a5e72af87f63a69f5586df10 Mon Sep 17 00:00:00 2001 From: Nour Elgeziry Date: Mon, 19 Oct 2020 18:20:11 +0100 Subject: [PATCH 10/14] implemented removing items from both baskets. --- EDMS/.vscode/settings.json | 3 +++ EDMS/EDMS/__init__.py | 2 -- EDMS/EDMS/celery.py | 21 ------------------ EDMS/db.sqlite3 | Bin 188416 -> 188416 bytes .../templates/shoppingCart/main.html | 16 +++++++------ EDMS/shoppingCart/views.py | 9 ++++---- EDMS/static/js/cart.js | 5 +++-- 7 files changed, 20 insertions(+), 36 deletions(-) create mode 100644 EDMS/.vscode/settings.json delete mode 100644 EDMS/EDMS/celery.py diff --git a/EDMS/.vscode/settings.json b/EDMS/.vscode/settings.json new file mode 100644 index 0000000..4c1277d --- /dev/null +++ b/EDMS/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/Users/nourelgeziry/.local/share/virtualenvs/Equal_Distribution_maintainance-M-bcKwQz/bin/python" +} \ No newline at end of file diff --git a/EDMS/EDMS/__init__.py b/EDMS/EDMS/__init__.py index 1e3599b..6944829 100644 --- a/EDMS/EDMS/__init__.py +++ b/EDMS/EDMS/__init__.py @@ -1,5 +1,3 @@ # This will make sure the app is always imported when -# Django starts so that shared_task will use this app. -from .celery import app as celery_app __all__ = ('celery_app',) \ No newline at end of file diff --git a/EDMS/EDMS/celery.py b/EDMS/EDMS/celery.py deleted file mode 100644 index b81af5d..0000000 --- a/EDMS/EDMS/celery.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -from celery import Celery - -# set the default Django settings module for the 'celery' program. -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'EDMS.settings') - -app = Celery('EDMS') - -# Using a string here means the worker doesn't have to serialize -# the configuration object to child processes. -# - namespace='CELERY' means all celery-related configuration keys -# should have a `CELERY_` prefix. -app.config_from_object('django.conf:settings', namespace='CELERY') - -# Load task modules from all registered Django app configs. -app.autodiscover_tasks() - - -@app.task(bind=True) -def debug_task(self): - print(f'Request: {self.request!r}') \ No newline at end of file diff --git a/EDMS/db.sqlite3 b/EDMS/db.sqlite3 index 9438e11ced35b11132853fb2e41d0619f848f330..03e8abb57adc6784249c4be8d338b6f5b70234e9 100644 GIT binary pat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@@ + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + + + {% if id_match == True %} + + + + + + + + + + + + + + + + + + + + + + + + {% endif %} +
Time Monday Tuesday WednesdaySaturday Sunday
AvailableAvailableAvailableAvailableAvailableAvailableAvailable9:00-10:00
AvailableAvailableAvailableAvailableAvailableAvailableAvailable10:00-11:00
AvailableAvailableAvailableAvailableAvailableAvailableAvailable11:00-12:00
AvailableAvailableAvailableAvailableAvailableAvailableAvailable12:00-13:00
13:00-14:00
14:00-15:00
diff --git a/EDMS/shoppingCart/urls.py b/EDMS/shoppingCart/urls.py index 2f6f0e0..87ba098 100644 --- a/EDMS/shoppingCart/urls.py +++ b/EDMS/shoppingCart/urls.py @@ -5,6 +5,6 @@ from django.urls import path urlpatterns = [ path('', views.main, name="main"), path('updateItem/', views.updateItem, name="updateItem"), - path('delivery/', views.delivery) + path('delivery/', views.deliveries) ] diff --git a/EDMS/shoppingCart/views.py b/EDMS/shoppingCart/views.py index 4f9a74e..472db8d 100644 --- a/EDMS/shoppingCart/views.py +++ b/EDMS/shoppingCart/views.py @@ -3,6 +3,7 @@ from .models import * # Create your views here. from django.http.response import JsonResponse import json +from .forms import * from django.contrib import messages @@ -14,12 +15,36 @@ def main(request): customerOrderItem = order.orderitem_set.all() products = Product.objects.all() - context = {'customer':customer, 'order':order, 'customerOrderItem':customerOrderItem, 'products':products} + context = {'customer':customer, 'order':order, 'customerOrderItem':customerOrderItem, 'products':products,} return render(request,'shoppingCart/main.html', context) #Delivery Page -def delivery(request): - return render(request,'shoppingCart/deliveries.html') +def deliveries(request): + timeslots = delivery.objects.all() + delivery1=timeslots[0] + delivery2=timeslots[1] + delivery3=timeslots[2] + delivery4=timeslots[3] + delivery5=timeslots[4] + delivery6=timeslots[5] + + + id_des = DisabledID.objects.get(id=5) + + + form = idform + id1 = request.POST.get('idfield') + id_match= False + if id1 == id_des.ID_Dis: + id_match = True + else: + print ("ID WRONG") + + + + context = {'timeslots':timeslots, 'id_des': id_des, 'delivery1':delivery1, 'delivery2':delivery2,'delivery3':delivery3, 'delivery4':delivery4,'delivery5':delivery5, 'delivery6':delivery6, 'form': form, 'id_match': id_match} + + return render(request,'shoppingCart/deliveries.html', context) #Updateitem view def updateItem(request): diff --git a/EDMS/static/css/main.css b/EDMS/static/css/main.css index 9413cef..57f2966 100644 --- a/EDMS/static/css/main.css +++ b/EDMS/static/css/main.css @@ -4,7 +4,6 @@ } #submit:active{ - background-color: #7fad39; color: black; } @@ -17,6 +16,29 @@ position: relative; } + +#timeslotbutton +{ + background: #7fad39; + border: 1px solid #ccc; + border-radius: 3px; + cursor: pointer; + margin-left: auto!important; + margin-right: auto!important; +} + + +#disabled1 +{ +visibility: hidden; +} + +#disabled2 +{ + visibility: hidden; +} + + h7 { font-size: 20px; ; @@ -160,3 +182,6 @@ button { } tr:hover {background-color:lightgray;} + + + From 07428d4cd4ccb0f7e511a643e294975daa6f10b7 Mon Sep 17 00:00:00 2001 From: Nour Elgeziry Date: Tue, 20 Oct 2020 17:29:26 +0100 Subject: [PATCH 13/14] Done --- EDMS/shoppingCart/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EDMS/shoppingCart/views.py b/EDMS/shoppingCart/views.py index 571d5de..25ac673 100644 --- a/EDMS/shoppingCart/views.py +++ b/EDMS/shoppingCart/views.py @@ -110,6 +110,6 @@ def updateItem(request): if orderItemWeek.quantity <= 0: orderItemWeek.delete() - print('ProductID: ', productId, 'Action:',action) + print('ProductID__: ', productId, 'Action:',action) return JsonResponse('item added', safe=False) From 443ca980176c7008194a9efcb980acc7c4166373 Mon Sep 17 00:00:00 2001 From: "Nourelrahman Elgeziry (elgezirn)" Date: Wed, 21 Oct 2020 16:13:19 +0100 Subject: [PATCH 14/14] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dc68c92..40f124c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Equal-Distribution-maintenance-system Testing pipline CI Testing pipline CD +Testing merging