Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #33

Merged
merged 465 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
465 commits
Select commit Hold shift + click to select a range
5dbe882
Fix(accounts/views): fix a bug for CustomerSetPasswordView access dec…
athfemoiur Aug 30, 2021
99f314e
Fix(accounts/views): fix a bug for CustomerChangePasswordView access …
athfemoiur Aug 30, 2021
5186d06
Add(address/forms): create service address create, update form
MrMohammadY Aug 30, 2021
aa3abed
Add(address/views): create service create view
MrMohammadY Aug 30, 2021
850c3c3
Add(address/urls): create service address create url
MrMohammadY Aug 30, 2021
098b907
Fix(address/views): add success url field to service address create view
MrMohammadY Aug 30, 2021
1062ec2
Update(address/urls): update service address create url
MrMohammadY Aug 30, 2021
8998668
Add(address/views): create service address update view and refactor s…
MrMohammadY Aug 30, 2021
b3ac78a
Add(address/urls): create service address update view
MrMohammadY Aug 30, 2021
d2defe8
Clean(accounts/views): remove unused import
athfemoiur Aug 30, 2021
0308684
Update(accounts/forms): add phone_number validator
athfemoiur Aug 30, 2021
af8752a
Delete(accounts/forms): remove clean_username , clean_password, clean…
athfemoiur Aug 30, 2021
2c1c7ab
Update(accounts/models): change the max_length of phone_number in bot…
athfemoiur Aug 30, 2021
eba728f
Update(account/templates/customer): remove <br> from profile.html
athfemoiur Aug 30, 2021
7537341
Add(library/utils): add CustomUserPasses class
athfemoiur Aug 31, 2021
e8e0e6b
Refactor(address/models, admin): rename the address model field and c…
MrMohammadY Aug 31, 2021
1f1040b
Fix(service/models): fix the service model field
MrMohammadY Aug 31, 2021
00e55e8
Fix(service/models): fix the model field
MrMohammadY Aug 31, 2021
2227df6
Migrations: create the migrations
MrMohammadY Aug 31, 2021
eafdfc9
Add(library/utils): create a custom user passess test
MrMohammadY Aug 31, 2021
8c811f7
Update(address/views): use custom passess test in all views
MrMohammadY Aug 31, 2021
82c3cbf
Update(accounts.views): use CustomUserPasses in CustomerChangePasswor…
athfemoiur Aug 31, 2021
cc998e7
Fix: fix the custom user passes test
MrMohammadY Aug 31, 2021
e574529
Update(accounts): remove pk place holder from 2 customer urls
athfemoiur Aug 31, 2021
1dd3224
Merge pull request #18 from jamedadi/accounts_add_feature
MrMohammadY Aug 31, 2021
2dab97d
Merge pull request #19 from jamedadi/feature_address_mohammad
MrMohammadY Aug 31, 2021
0eb751e
Update(address/views): update user passess tests
MrMohammadY Aug 31, 2021
15b9833
Add(templatetags): add some filter for users
MrMohammadY Aug 31, 2021
0541e30
Add(base-templates): create the base templates for project
MrMohammadY Aug 31, 2021
21a0d2f
Add(address/views): create customer address list
MrMohammadY Aug 31, 2021
ca43cc4
Add(address/urls): create customer address list url
MrMohammadY Aug 31, 2021
14cdba7
Add(urls): add home path url for test
MrMohammadY Aug 31, 2021
7f975da
Style(accounts/templates): style accounts templates
MrMohammadY Aug 31, 2021
641d3a9
Style(address/templates): style address templates
MrMohammadY Aug 31, 2021
857f23e
Fix(address/views): customer create address view fixed
MrMohammadY Aug 31, 2021
f6d78da
Style(accouns/templates): update template
MrMohammadY Aug 31, 2021
aad810f
Update(item/models): overrider the save method of Item model
athfemoiur Sep 1, 2021
e50103b
(item/urls, snapp_food/urls): add urls to item app and include it to …
athfemoiur Sep 1, 2021
e5a6bf4
Add(item/views, forms): add CreateItemForm and CreateItemView classes
athfemoiur Sep 1, 2021
150fcdf
Add(templates/item): add create_form.html
athfemoiur Sep 1, 2021
719370b
Update(item/views): add test_func for CreatItemView
athfemoiur Sep 1, 2021
f90b0f8
Add(item/views, forms): add ItemUpdatForm and ItemUpdateView
athfemoiur Sep 1, 2021
e93544d
Update(item/urls): add update url
athfemoiur Sep 1, 2021
3d02ec3
Add(item/views): add ItemDetailView
athfemoiur Sep 1, 2021
625d0da
Update(item/views): add get_queryset method to ItemDetailVies
athfemoiur Sep 1, 2021
e0bc25b
Add(service/forms): create forms file
MrMohammadY Sep 1, 2021
3203056
Add(service/urls): create urls file
MrMohammadY Sep 1, 2021
b2ce819
Add(urls): including service urls in base urls
MrMohammadY Sep 1, 2021
0b81600
Add(service/forms): create service create form
MrMohammadY Sep 1, 2021
ee59f0f
Style(service/templates): make service create template
MrMohammadY Sep 1, 2021
ab67b6e
Add(service/views): create service create view
MrMohammadY Sep 1, 2021
92e8a90
Add(service/urls): create service create url
MrMohammadY Sep 1, 2021
097652a
Style(service/templates): create service list template
MrMohammadY Sep 1, 2021
c9649f3
Add(service/views): create service list view
MrMohammadY Sep 1, 2021
41d3ab2
Add(service/urls): create service list url
MrMohammadY Sep 1, 2021
5ca6cb9
Refactor(service/views): rename service create form
MrMohammadY Sep 1, 2021
5b311cc
Add(service/views): create service update view
MrMohammadY Sep 1, 2021
b0f922f
Style(service/templates): refactor templates
MrMohammadY Sep 1, 2021
54a6b63
Refactor(service/views): rename template name
MrMohammadY Sep 1, 2021
1c713c4
Add(service/urls): create service update url
MrMohammadY Sep 1, 2021
a47f305
Style(service/templates): update service list templates
MrMohammadY Sep 1, 2021
91aeb02
Style(service/templates): create service delete templates
MrMohammadY Sep 1, 2021
146566f
Add(service/views): create service delete view
MrMohammadY Sep 1, 2021
0e93c19
Add(service/urls): create service delete url
MrMohammadY Sep 1, 2021
5787fd4
Add(item/views, templates, urls): add template for item views and add…
athfemoiur Sep 1, 2021
b598080
Add(service/utils): create new class for user in all service views
MrMohammadY Sep 1, 2021
15ff640
Add(service/views): create service detail view
MrMohammadY Sep 1, 2021
1dd2202
Add(service/urls): create service detail url
MrMohammadY Sep 1, 2021
be09b8e
Style(service/templates): create service detail template and edit ser…
MrMohammadY Sep 1, 2021
2380610
Update(items/views): handle creating the itemInline int the related view
athfemoiur Sep 1, 2021
bf2986d
Style(service/templates): update templates style
MrMohammadY Sep 1, 2021
5d8752a
Style(accounts/templates): update templates style
MrMohammadY Sep 1, 2021
7903391
Update(service/views): update service create view success url field
MrMohammadY Sep 1, 2021
4681790
Update(item/admin): add ItemLine to item detail in panel admin
athfemoiur Sep 1, 2021
6b0ba3d
Update(item/templates): style the detail.html
athfemoiur Sep 1, 2021
7be1dd4
Add(templates): add admin navbar
athfemoiur Sep 1, 2021
2d334de
Update(service/models): override service category model's save method
MrMohammadY Sep 1, 2021
adaa734
Add(service/form): create service category create update form
MrMohammadY Sep 1, 2021
a5a70d6
Style(service/templates/service_category): create service category te…
MrMohammadY Sep 1, 2021
21a1f5f
Style(service/templates/service): update template
MrMohammadY Sep 1, 2021
3a0c54d
Add(service/views): create service category create view
MrMohammadY Sep 1, 2021
7b56635
Add(service/urls): create service category create url
MrMohammadY Sep 1, 2021
04ad410
Add(service/views): create service category update view
MrMohammadY Sep 1, 2021
20de64a
Add(service/urls): create service category update url
MrMohammadY Sep 1, 2021
41ba795
Style(service/templates): update templates styles
MrMohammadY Sep 1, 2021
9a87366
Add(service/views): create service category delete view
MrMohammadY Sep 1, 2021
9e64391
Add(service/urls): create service category delete url
MrMohammadY Sep 1, 2021
faf3824
Style(service/template): createservice category delete view and update
MrMohammadY Sep 1, 2021
9983e18
Add(item/views, forms): add a factory function for ItemUpdateForm class
athfemoiur Sep 1, 2021
48fbc69
Add(item/views, urls, templates): add item delte functionality
athfemoiur Sep 1, 2021
4d18271
Add(service/views): create service category detail view
MrMohammadY Sep 1, 2021
f2cb4fc
Add(service/urls): create service category detail url
MrMohammadY Sep 1, 2021
4ceeb4d
Style(service/template): createservice category detail view and update
MrMohammadY Sep 1, 2021
6285b91
Add(service/forms): create delivery area create update form
MrMohammadY Sep 1, 2021
cd2a1f1
Add(service/views): create delivery area create view
MrMohammadY Sep 1, 2021
96a14a2
Add(service/urls): create delivery area create url
MrMohammadY Sep 1, 2021
f2d7f88
Style(service/template): create service delivery area template and up…
MrMohammadY Sep 1, 2021
8df6e43
Update(service/views): update service views
MrMohammadY Sep 1, 2021
f46ae39
Add(service/views): create delivery area update view
MrMohammadY Sep 1, 2021
f824496
Add(service/urls): create delivery area update url
MrMohammadY Sep 1, 2021
412de08
Style(service/template): create service delivery area update template…
MrMohammadY Sep 1, 2021
3487313
Add(service/views): create delivery area delete view
MrMohammadY Sep 1, 2021
c089429
Add(service/urls): create delivery area delete url
MrMohammadY Sep 1, 2021
79828e4
Style(service/template): create service delivery area delete template…
MrMohammadY Sep 1, 2021
f63b23f
Update(item/forms, views): remove item_update_form_factory and make i…
athfemoiur Sep 1, 2021
fdf7bc4
Add(item/views, templates): add ItemListView view and template
athfemoiur Sep 1, 2021
50a6532
Test(item/urls): add a url for testing the ServiceCategoryItemListView
athfemoiur Sep 2, 2021
ea0019b
Add(item/views, urls, templates): add view and template for item list…
athfemoiur Sep 2, 2021
a6eca11
Update(item/views): change the success_url of ItemUpdateView
athfemoiur Sep 2, 2021
2ca40c4
Add(snapp_food/urls, settings): add static and media condigs in setti…
athfemoiur Sep 2, 2021
e31bb72
Add(item/tempaltes): add img for item detail and item detail service …
athfemoiur Sep 2, 2021
2d3912b
Fix(service/models): fix the tables and djagno admin
MrMohammadY Sep 2, 2021
298394a
Migrations(service/migrations): create new migration
MrMohammadY Sep 2, 2021
ed0fbec
Add(service/forms): create available time create update form
MrMohammadY Sep 2, 2021
0b4d6e0
Add(service/views): create service available time create view
MrMohammadY Sep 2, 2021
7b66f1a
Add(service/urls): create service available time create url
MrMohammadY Sep 2, 2021
d36f5d8
Style(service/templates): create service available time template
MrMohammadY Sep 2, 2021
c1d6258
Refactor(service/views): use inheritance in some views
MrMohammadY Sep 2, 2021
4d83127
Update(service/views): add login required decorator
MrMohammadY Sep 2, 2021
29d4fa5
Update(service/models): update ordering service avilable time
MrMohammadY Sep 2, 2021
e72b346
Add(service/views): create service available time update view
MrMohammadY Sep 2, 2021
406d086
Add(service/urls): create service available time update url
MrMohammadY Sep 2, 2021
6d99a77
Style(service/templates): update templates
MrMohammadY Sep 2, 2021
6b45482
Add(service/views): create service available time delete view
MrMohammadY Sep 2, 2021
e74ec92
Add(service/urls): create service available time delete url
MrMohammadY Sep 2, 2021
aa8f71b
Style(service/templates): update templates
MrMohammadY Sep 2, 2021
7ea6aa5
Refactor(service/templates): refactor all templates directory
MrMohammadY Sep 2, 2021
efc68d7
Update(item/urls): add service-provider-list , list , detail-service-…
athfemoiur Sep 2, 2021
ad7590e
Refactor(service): refactor service views, urls, templates
MrMohammadY Sep 2, 2021
6bc394c
Style(item/tempalte): style item templates
athfemoiur Sep 2, 2021
8a47f90
Chore(.gitignore): add media/ to gitignore
athfemoiur Sep 2, 2021
500f9bf
Chore(.gitignore): remove media from tracked items
athfemoiur Sep 2, 2021
e0cd7df
Update(item/templates): add encrypt for create and update form
athfemoiur Sep 3, 2021
9b8ef68
Update(service/models): update service model and add images fields
MrMohammadY Sep 3, 2021
9e976be
Update(service/forms): update service create update form for image fi…
MrMohammadY Sep 3, 2021
c8e9cc0
Update(item/tempaltes): add image for item_list and service_provider_…
athfemoiur Sep 3, 2021
533f259
Add(service/views): create service list view
MrMohammadY Sep 3, 2021
5792d91
Add(service/urls): create service list url
MrMohammadY Sep 3, 2021
469bbbf
Update(settings): add media root and media url
MrMohammadY Sep 3, 2021
5d25732
Update(urls): add media root and url in project
MrMohammadY Sep 3, 2021
2b1b9be
Update(address/models): update str method
MrMohammadY Sep 3, 2021
75f7ced
Migrations(service/migrations): create new migrations
MrMohammadY Sep 3, 2021
f9f220e
Style(templates): update all templates
MrMohammadY Sep 3, 2021
330272e
Add(service/templatetags): create new filter for project
MrMohammadY Sep 3, 2021
33f4a4e
Chore(gitignore): add media in gitignore
MrMohammadY Sep 3, 2021
c2043d1
Merge pull request #20 from jamedadi/item_app_athfemoiur
MrMohammadY Sep 3, 2021
caf8095
Merge branch 'merge_branch' into feature_service
MrMohammadY Sep 3, 2021
ca54242
Merge pull request #21 from jamedadi/feature_service
MrMohammadY Sep 3, 2021
bd2d2ad
Add(settings): add django filter to install apps
MrMohammadY Sep 3, 2021
3566385
Add(service/filters): create service filters
MrMohammadY Sep 3, 2021
972f364
Update(service/views): delete detail view and update service list view
MrMohammadY Sep 3, 2021
0342569
Update(service/urls): delete detail url
MrMohammadY Sep 3, 2021
9191ca4
Style(service/templates, item/templates): update templates
MrMohammadY Sep 3, 2021
2c4a4d4
Merge pull request #22 from jamedadi/feature_service
MrMohammadY Sep 3, 2021
52c3228
Update(requirements): add django-filter to requirements.txt
athfemoiur Sep 3, 2021
b06bf68
Update(address/tempaltes): comment else scope in create_update_form
athfemoiur Sep 3, 2021
7cb8563
Update(item/templates): add category navbar
athfemoiur Sep 3, 2021
c7c9167
Update(item/views, urls): change the url of item-list and the view(ca…
athfemoiur Sep 3, 2021
0819661
Add(item/tempaltetags): add category_template tags and filter_categor…
athfemoiur Sep 3, 2021
4bbf258
Fix(item/tempaltes): fix a bug in item_list.html
athfemoiur Sep 3, 2021
88fa997
Fix(service/tempaltes/list.html): remove category_pk from item_list url
athfemoiur Sep 3, 2021
0e8e4a6
Merge pull request #23 from jamedadi/feature_item_athfemoiur
MrMohammadY Sep 3, 2021
0424270
Style(address/templates/create-update-form/): fix cancel link
MrMohammadY Sep 3, 2021
4317b0f
Style(templates/inc/customer-navbar): add address link in navbar
MrMohammadY Sep 3, 2021
be9a510
Style(item/tempaltes): replace the navbar with a sidebar for item list
athfemoiur Sep 3, 2021
7f66362
Style(item/templates): style item_list.html
athfemoiur Sep 4, 2021
4736783
Update(cart/models): update cart and cartline models and fix those
MrMohammadY Sep 7, 2021
d623f68
Migration(cart/migrations): edit initual migration
MrMohammadY Sep 7, 2021
da97217
Add(urls): including cart url
MrMohammadY Sep 7, 2021
a721fdf
Add(cart/views): create add to cart view
MrMohammadY Sep 7, 2021
3c9bbc8
Add(cart/urls): create add to cart url
MrMohammadY Sep 7, 2021
fc71ac2
Add(cart/templatetags): create cart filters
MrMohammadY Sep 7, 2021
f4909eb
Style(templates): update templates
MrMohammadY Sep 7, 2021
ea207ea
Comment(cart/models): add a cooment for CartLine unique_together
athfemoiur Sep 7, 2021
9a62af0
Add(cart/views): create CartLineDeleteView class with get_success_url…
athfemoiur Sep 7, 2021
befc4b3
Update(cart/urls): add cart-line-delete url to cart.urls
athfemoiur Sep 7, 2021
6513103
Add(cart/views): create CartLineDecreaseView view
athfemoiur Sep 7, 2021
8f4a428
Update(cart/urls): add cart-line-decrease url to cart.urls
athfemoiur Sep 7, 2021
ac5ea6f
Update(templates/cart): add cart:cart-line-decrease and cart:cart-lin…
athfemoiur Sep 7, 2021
c8efc0e
Clean(cart/views): clean code in CartLineDecreaseView view
athfemoiur Sep 7, 2021
104fb95
Update(cart/models, templates/item): add price property for CartLine …
athfemoiur Sep 7, 2021
95b8e56
Add(template/item/item_list): add empty cart link
athfemoiur Sep 7, 2021
4fc0e55
Add(cart/views): add EmptyCartView
athfemoiur Sep 7, 2021
3f06c2e
Update(cart/views, urls): complete empty cart functionality:
athfemoiur Sep 7, 2021
e20c967
Merge pull request #24 from jamedadi/feature_cart_athfemoiur
MrMohammadY Sep 7, 2021
630e38e
Merge branch 'merge_branch' into feature_cart_mohammad
MrMohammadY Sep 7, 2021
ccb5e18
Merge pull request #25 from jamedadi/feature_cart_mohammad
MrMohammadY Sep 7, 2021
69bc82d
Update(cart/views): change get_cart method
athfemoiur Sep 8, 2021
ee7185f
Update(cart/): complete cart views with cookie
athfemoiur Sep 9, 2021
597113f
Merge pull request #26 from jamedadi/feature_cart_cookie
MrMohammadY Sep 12, 2021
81325ab
Add(gateway/): create gateway app
athfemoiur Sep 12, 2021
02b5fe8
Update(settings): add gateway to installed apps
athfemoiur Sep 12, 2021
e445cec
Update(cart/models, payment/models): add cart to Invoice model and re…
athfemoiur Sep 12, 2021
bf6d92c
Update(payment/models): add customer, log, authority fields to Payment
athfemoiur Sep 12, 2021
071e8da
Add(gateway/models): create Gateway model
athfemoiur Sep 12, 2021
01564a6
Add(gateway/utils): create utils python package
athfemoiur Sep 12, 2021
7269830
Update(payment/models): add gateway fk to Payment
athfemoiur Sep 12, 2021
397d91a
Update(cart/mdoels): remove Invoice import due to circular import
athfemoiur Sep 12, 2021
7aaeaaf
Add(migrations): make new migrations for model changes
athfemoiur Sep 12, 2021
9a3ec94
Add(gateway/admin): create GatewayAdmin class
athfemoiur Sep 12, 2021
824ded8
Update(gateway/models): add str method for Gateway
athfemoiur Sep 12, 2021
51e086e
Update(payment/admin): add new fields to InvoiceAdmin and PaymentAdmin
athfemoiur Sep 12, 2021
80eaa78
Update(gateway/models): add class Meta for Gateway model
athfemoiur Sep 12, 2021
f8a421f
Add(payment/forms): create AddressSelectForm, GatewaySelectForm classes
athfemoiur Sep 13, 2021
f0be38a
Update(snappfood/urls, payment/urls): include payment.urls to project…
athfemoiur Sep 13, 2021
b7a4556
Add(payment/views, tempaltes): create CheckoutView and its template
athfemoiur Sep 13, 2021
94eb954
Add(cart/models): add total_price property
athfemoiur Sep 13, 2021
e4dd901
Update(item/templates/item_list): add checkout link href
athfemoiur Sep 13, 2021
c59532e
Update(payment/models): add create and create_payment class methods
athfemoiur Sep 13, 2021
aece2a4
Update(payment/views): add post method for CheckoutView
athfemoiur Sep 13, 2021
d77e717
Add(gatway/utils): add zarrinpall request,verify handler
MrMohammadY Sep 13, 2021
f648b04
Add(settings): adding call back variable in setting
MrMohammadY Sep 13, 2021
de04e1a
Style(templates): update templates
MrMohammadY Sep 13, 2021
9d9f58a
Update(gateway/models): update gateway model and add some methods
MrMohammadY Sep 13, 2021
c06ee2e
Update(payment/models): update payment model and add some methods
MrMohammadY Sep 13, 2021
c73b8a7
Add(payment/views, payment/urls): add payment verification view and url
MrMohammadY Sep 13, 2021
b08bb56
Style(templates): update templates
MrMohammadY Sep 13, 2021
58ff7aa
Merge pull request #27 from jamedadi/feature_payment
MrMohammadY Sep 13, 2021
bae412e
Update(order/models): add class Meta, change invoice relation to 1to1
athfemoiur Sep 13, 2021
d1bfce6
Update(requirements): add suds-jurko pakcage
athfemoiur Sep 13, 2021
e3f708a
Update(order/models): add class Meta, customer 1to1 rel and create me…
athfemoiur Sep 13, 2021
6ccadde
Update(payment/models): call Order create method in verify
athfemoiur Sep 13, 2021
4dffeb8
Update(payment/views): remove setup override
athfemoiur Sep 13, 2021
cba10c7
Migration(order/migrations): add new migration
athfemoiur Sep 13, 2021
0cd8fd5
Update(sanppfood/urls): include order urls
athfemoiur Sep 13, 2021
74c0006
Add(order/urls): add urlpatterns to urls.py
athfemoiur Sep 13, 2021
99c2c63
Add(order/views): create CustomerOrderDetailView
athfemoiur Sep 13, 2021
b7e503c
add order_list and order_detail for customers
athfemoiur Sep 13, 2021
882cc16
Update(templates/inc): add orders link in navbar
athfemoiur Sep 13, 2021
4adb887
Update(order/): remove is_delivered field and add it to status
athfemoiur Sep 13, 2021
734141a
Update(order/): seprate order list into active and delivered
athfemoiur Sep 13, 2021
7d70c95
Update(templates/accounts/customer): add orders link to profile tempalte
athfemoiur Sep 13, 2021
a82208a
Update(payment/models): fix user_email arg in get_request_handler_data
athfemoiur Sep 16, 2021
ea15329
Add(urls): including order urls
MrMohammadY Sep 16, 2021
5e63c02
Update(payment/models): add None for user_email getattr
athfemoiur Sep 16, 2021
47123da
Update(order/models): update order status
MrMohammadY Sep 16, 2021
a394c18
Migration(order/migrations): create new migrations for status
MrMohammadY Sep 16, 2021
8ce1c28
Add(order/views, urls, filters): create order service views and urls
MrMohammadY Sep 16, 2021
b5cb54e
Style(templates): update templates
MrMohammadY Sep 16, 2021
cff5b0c
Merge pull request #28 from jamedadi/feature_order_customer
MrMohammadY Sep 16, 2021
e814b18
Merge branch 'feature_order' into feature_order_service_provider
MrMohammadY Sep 16, 2021
f5de4cb
Merge pull request #29 from jamedadi/feature_order_service_provider
MrMohammadY Sep 16, 2021
89e7dda
Update(order/views): check user for access to views
MrMohammadY Sep 16, 2021
4588a63
Merge pull request #30 from jamedadi/feature_order
MrMohammadY Sep 16, 2021
beda495
Refactor: rename the project
MrMohammadY Sep 16, 2021
b021c6d
Migration(order/migrations): create new migtration
MrMohammadY Sep 16, 2021
0fa342a
Doc(README): update readme
MrMohammadY Sep 16, 2021
9aa61bd
Style(templates): update templates
MrMohammadY Sep 16, 2021
3086ee1
Merge pull request #31 from jamedadi/merge_branch
MrMohammadY Sep 16, 2021
6d32626
Merge branch 'main' into develop
MrMohammadY Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__pycache__/
*.py[cod]
*$py.class

media/
# C extensions
*.so

Expand Down Expand Up @@ -54,6 +54,7 @@ coverage.xml
# Translations
*.mo
*.pot
.idea/

# Django stuff:
*.log
Expand Down Expand Up @@ -127,3 +128,6 @@ dmypy.json

# Pyre type checker
.pyre/

# media
media/
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
Yummy
---
**This project is going to be a clone of sanpp food with Python and Django framework.**

---

## What is yummy?

It’s actually a service which users can order food very easily and restaurant managers can register their services so
that other people can use them.

As I said this is going to be a clone of this service , clearly It’s not going to implement all the features

---

## The goal of this project:

The main purpose of this project is being an acceptable resume and also a good practice of Django framework

---

## Features:

- [x] We will have two type of users in this project : 1 - Customer 2 - Service Provider.
- [x] Each service provider can provide different services such as (restaurant, fast food, confectionery, supermarket,
…).
- [x] Each service will be able to have a menu containing different items.
- [x] Each service will be able to have custom categories for the items of the menu.
- [x] Each service provider must specify the supported areas for the item delivery for the service.
- [ ] Each service provider can add discount on some of their items for a limited time.
- [x] Each service will have active days and hours.
- [x] Each customer can have different addresses.
- [x] Each customer will be able to see the services(only the supported services in their area).
- [x] Each customer can add items to their cart(note : Each cart can only contain items from one specific service, that
means adding items from different services causes multiple carts).
- [ ] Each customer will be able to add comment for the items which was in their cart after the order was delivered(
note: customers will be able to add one comment for an item after each successful order).
- [ ] Each item will have a score based on its comments.
- [x] Each user will be to see the status of the order after the payment has been successful.
- [ ] The quantity of each item must be increased and decreased at successful orders.

---

## Architecture of the project:

The project is based on the MVT architecture of the Django framework, so we will use SSR(server side rendering)

---
Empty file added accounts/__init__.py
Empty file.
22 changes: 22 additions & 0 deletions accounts/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from django.contrib import admin
from django.contrib.auth.hashers import make_password

from accounts.models import Customer, ServiceProvider


@admin.register(Customer)
class CustomerAdmin(admin.ModelAdmin):
list_display = ('phone_number', 'first_name', 'last_name', 'date_joined', 'is_active')
list_filter = ('is_active', 'date_joined')
search_fields = ('phone_number',)

def save_model(self, request, obj, form, change):
obj.password = make_password(form.cleaned_data['password'])
return super().save_model(request, obj, form, change)


@admin.register(ServiceProvider)
class ServiceProviderAdmin(admin.ModelAdmin):
list_display = ('username', 'email', 'phone_number', 'date_joined', 'is_active')
list_filter = ('is_active', 'date_joined')
search_fields = ('username', 'phone_number')
6 changes: 6 additions & 0 deletions accounts/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'
42 changes: 42 additions & 0 deletions accounts/authenticate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from django.contrib.auth.backends import BaseBackend

from accounts.models import Customer, ServiceProvider


class PhoneNumberPasswordBackend(BaseBackend):
def authenticate(self, request, phone_number=None, password=None):
try:
customer = Customer.objects.get(phone_number=phone_number)
except Customer.DoesNotExist:
return None
else:
if password: # if the password is sent via the form
if customer.check_password(password):
return customer
else:
return None
return customer

def get_user(self, user_id):
try:
customer = Customer.objects.get(pk=user_id)
except Customer.DoesNotExist:
return None
else:
return customer


class ServiceProviderAuthentication(BaseBackend):
def authenticate(self, request, username=None, password=None):
try:
user = ServiceProvider.objects.get(username=username, password=password)
return user

except ServiceProvider.DoesNotExist:
return None

def get_user(self, user_id):
try:
return ServiceProvider.objects.get(pk=user_id)
except ServiceProvider.DoesNotExist:
return None
166 changes: 166 additions & 0 deletions accounts/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
from django import forms
from django.contrib.auth import password_validation
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.core.validators import int_list_validator
from django.utils.translation import gettext_lazy as _

from accounts.models import ServiceProvider, Customer
from accounts.utils import phone_number_validator


class CustomerLoginRegisterForm(forms.Form):
phone_number = forms.CharField(max_length=12,
validators=[
int_list_validator(message=_('only digits are accepted')),
phone_number_validator
],
widget=forms.TextInput(
attrs={'class': 'form-control', 'placeholder': 'phone number'})
)


class CustomerCodeConfirmForm(forms.Form):
code = forms.CharField(
validators=[int_list_validator(message=_('only digits are accepted'))],
widget=forms.TextInput(
attrs={
'class': 'form-control',
'placeholder': _('confirmation code')
}
)
)


class CustomerPasswordForm(forms.Form):
password = forms.CharField(
widget=forms.PasswordInput(
attrs={
'class': 'form-control',
'placeholder': _('password')
}
)
)


class CustomerPasswordSetForm(forms.ModelForm):
error_messages = {
'password_mismatch': _('The two password fields didn’t match.'),
}
password = forms.CharField(
label=_("Password"),
strip=False,
widget=forms.PasswordInput(attrs={'autocomplete': 'new-password'}),
help_text=password_validation.password_validators_help_text_html(),
)
password2 = forms.CharField(
label=_("Password confirmation"),
widget=forms.PasswordInput(attrs={'autocomplete': 'new-password'}),
strip=False,
help_text=_("Enter the same password as before, for verification."),
)

class Meta:
model = Customer
fields = ('password',)

def clean_password2(self):
password = self.cleaned_data.get("password")
password2 = self.cleaned_data.get("password2")
if password and password2 and password != password2:
raise ValidationError(
self.error_messages['password_mismatch'],
code='password_mismatch',
)
return password2

def save(self, commit=True):
customer = super().save(commit=False)
customer.set_password(self.cleaned_data["password"])
if commit:
customer.save()
return customer


class CustomerProfileUpdateForm(forms.ModelForm):
class Meta:
model = Customer
fields = ('first_name', 'last_name')


class ServiceProviderRegistrationForm(forms.ModelForm):
username = forms.CharField(
max_length=30,
min_length=4,
widget=forms.TextInput(
attrs={
'placeholder': 'Username',
'class': 'form-control'}
)
)
phone_number = forms.CharField(max_length=12,
validators=[
int_list_validator(message=_('only digits are accepted')),
phone_number_validator
],
widget=forms.TextInput(
attrs={'class': 'form-control', 'placeholder': 'phone number'})
)
confirm_password = forms.CharField(
widget=forms.PasswordInput(
attrs={
'placeholder': 'Confirm Password',
'class': 'form-control'}
)
)

class Meta:
model = ServiceProvider
fields = ('username', 'email', 'phone_number', 'password', 'confirm_password')
widgets = {
'email': forms.EmailInput(attrs={'placeholder': 'Email', 'class': 'form-control'}),
'phone_number': forms.TextInput(attrs={'placeholder': 'Phone Number', 'class': 'form-control'}),
'password': forms.PasswordInput(attrs={'placeholder': 'Password', 'class': 'form-control'}),
}

def clean_confirm_password(self):
if self.cleaned_data['password'] != self.cleaned_data['confirm_password']:
raise ValidationError('passwords not equal!')
return self.cleaned_data['confirm_password']


class ServiceProviderLoginForm(forms.Form):
username = forms.CharField(
min_length=4,
widget=forms.TextInput(
attrs={
'placeholder': 'Username, Email, Phone Number',
'class': 'form-control'}
)
)

password = forms.CharField(
max_length=30,
min_length=4,
widget=forms.PasswordInput(
attrs={
'placeholder': 'Password',
'class': 'form-control'}
)
)

def clean(self):
cleaned_data = super().clean()

username = cleaned_data['username']
user = ServiceProvider.objects.filter(
Q(username=username) |
Q(email=username) |
Q(phone_number=username),
).first()

if user and user.check_password(cleaned_data['password']):
cleaned_data['user'] = user
return cleaned_data

raise ValidationError('username or password invalid!')
62 changes: 62 additions & 0 deletions accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generated by Django 3.2 on 2021-08-28 20:31

import accounts.models
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Customer',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('phone_number', models.CharField(max_length=13, unique=True, verbose_name='phone number')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
],
options={
'verbose_name': 'Customer',
'verbose_name_plural': 'Customers',
'db_table': 'customer',
},
managers=[
('objects', accounts.models.CustomerManager()),
],
),
migrations.CreateModel(
name='ServiceProvider',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('email', models.EmailField(blank=True, max_length=254, unique=True, verbose_name='email address')),
('phone_number', models.CharField(max_length=13, unique=True, verbose_name='phone number')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
],
options={
'verbose_name': 'Service provider',
'verbose_name_plural': 'Service providers',
'db_table': 'service_provider',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]
Loading