generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update quotes app to be pep8 compliant
- Loading branch information
1 parent
5dd19f9
commit 144f39d
Showing
6 changed files
with
352 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
from django.contrib import admin | ||
from quotes.models import QuoteRequest, QuoteOrder, QuoteFufillment | ||
|
||
# Register your models here. | ||
|
||
@admin.register(QuoteRequest) | ||
class QuoteRequestAdmin(admin.ModelAdmin): | ||
list_display = ('name', 'user', 'submitted', 'quote_request_number') | ||
readonly_fields = ('quote_request_number',) | ||
list_display = ("name", "user", "submitted", "quote_request_number") | ||
readonly_fields = ("quote_request_number",) | ||
|
||
|
||
@admin.register(QuoteOrder) | ||
class QuoteOrderAdmin(admin.ModelAdmin): | ||
list_display = ('quote_request_name', 'user', 'submitted', 'quote_order_number') | ||
readonly_fields = ('quote_request_name', 'type', 'size', 'description', | ||
'subtotal', 'discount', 'total', 'quote_order_number') | ||
list_display = ( | ||
"quote_request_name", | ||
"user", "submitted", | ||
"quote_order_number" | ||
) | ||
readonly_fields = ( | ||
"quote_request_name", | ||
"type", | ||
"size", | ||
"description", | ||
"subtotal", | ||
"discount", | ||
"total", | ||
"quote_order_number", | ||
) | ||
|
||
|
||
@admin.register(QuoteFufillment) | ||
class QuoteFufillmentAdmin(admin.ModelAdmin): | ||
list_display = ('quote_order', 'image', 'status') | ||
list_display = ("quote_order", "image", "status") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
TYPE_CHOICES = [ | ||
('IC', 'Icon --- £9.99'), | ||
('LG', 'Logo --- £19.99'), | ||
('PS', 'Poster --- £39.99'), | ||
('ST', 'Sticker --- £9.99'), | ||
('WP', 'Wallpaper --- £39.99'), | ||
('BN', 'Banner --- £19.99'), | ||
("IC", "Icon --- £9.99"), | ||
("LG", "Logo --- £19.99"), | ||
("PS", "Poster --- £39.99"), | ||
("ST", "Sticker --- £9.99"), | ||
("WP", "Wallpaper --- £39.99"), | ||
("BN", "Banner --- £19.99"), | ||
] | ||
|
||
SIZE_CHOICES = [ | ||
('S', 'Small --- £9.99'), | ||
('M', 'Medium --- £19.99'), | ||
('L', 'Large --- £29.99'), | ||
] | ||
("S", "Small --- £9.99"), | ||
("M", "Medium --- £19.99"), | ||
("L", "Large --- £29.99"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,42 @@ | ||
from django.urls import path | ||
from quotes.views import ( | ||
QuoteRequestView, QuoteCheckoutView, QuoteCheckoutSuccess, | ||
QuoteHistoryView, QuoteHistoryDetail, QuoteOrderList, | ||
QuoteOrderFufillCreate, QuoteOrderFufillUpdate | ||
) | ||
QuoteRequestView, | ||
QuoteCheckoutView, | ||
QuoteCheckoutSuccess, | ||
QuoteHistoryView, | ||
QuoteHistoryDetail, | ||
QuoteOrderList, | ||
QuoteOrderFufillCreate, | ||
QuoteOrderFufillUpdate, | ||
) | ||
|
||
urlpatterns = [ | ||
path('', QuoteRequestView.as_view(), name='quote_request'), | ||
path('quote_orders', QuoteOrderList.as_view(), name='quote_orders'), | ||
path('quote_orders/fufill/<quote_order_number>', QuoteOrderFufillCreate.as_view(), name='quote_orders_fufill'), | ||
path('quote_orders/fufill/update/<quote_order_number>', QuoteOrderFufillUpdate.as_view(), name='quote_fufill_update'), | ||
path('quote_history/', QuoteHistoryView.as_view(), name='quote_history'), | ||
path('quote_history/<quote_order_number>', QuoteHistoryDetail.as_view(), name='quote_history_detail'), | ||
path('quote_checkout/', QuoteCheckoutView.as_view(), name='quote_checkout'), | ||
path('quote_checkout_success/<quote_order_number>', QuoteCheckoutSuccess.as_view(), name='quote_checkout_success'), | ||
] | ||
path("", QuoteRequestView.as_view(), name="quote_request"), | ||
path("quote_orders", QuoteOrderList.as_view(), name="quote_orders"), | ||
path( | ||
"quote_orders/fufill/<quote_order_number>", | ||
QuoteOrderFufillCreate.as_view(), | ||
name="quote_orders_fufill", | ||
), | ||
path( | ||
"quote_orders/fufill/update/<quote_order_number>", | ||
QuoteOrderFufillUpdate.as_view(), | ||
name="quote_fufill_update", | ||
), | ||
path("quote_history/", QuoteHistoryView.as_view(), name="quote_history"), | ||
path( | ||
"quote_history/<quote_order_number>", | ||
QuoteHistoryDetail.as_view(), | ||
name="quote_history_detail", | ||
), | ||
path( | ||
"quote_checkout/", | ||
QuoteCheckoutView.as_view(), | ||
name="quote_checkout" | ||
), | ||
path( | ||
"quote_checkout_success/<quote_order_number>", | ||
QuoteCheckoutSuccess.as_view(), | ||
name="quote_checkout_success", | ||
), | ||
] |
Oops, something went wrong.