Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Hunger Buster - Breadcrumbs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julia Santos
Hunger Buster - Breadcrumbs
Commits
94f0d60c
Commit
94f0d60c
authored
Mar 24, 2021
by
Julia Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Users can now view all items marked as To Buy
parent
2c6e3121
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
urls.py
Breadcrumbs/urls.py
+3
-2
views.py
Breadcrumbs/views.py
+8
-0
No files found.
Breadcrumbs/urls.py
View file @
94f0d60c
...
...
@@ -4,7 +4,7 @@ from django.conf.urls.static import static
from
django.views.generic
import
TemplateView
from
django.urls
import
include
,
path
from
Breadcrumbs
import
views
from
.views
import
ProductListViewName
,
ProductListViewCategory
,
add_product_type
,
delete_product_type
,
ItemViewPDate
,
add_item
,
delete_item
from
.views
import
ProductListViewName
,
ProductListViewCategory
,
add_product_type
,
delete_product_type
,
ItemViewPDate
,
add_item
,
delete_item
,
ToBuyViewName
urlpatterns
=
[
url
(
r'^fridge/list/'
,
ProductListViewName
.
as_view
(),
name
=
'fridgeLN'
),
...
...
@@ -16,7 +16,8 @@ urlpatterns = [
path
(
'fridge/<id>/delete'
,
delete_product_type
,
name
=
'product-type-delete'
),
url
(
r'^fridge/(?P<Product_ID>\d+)/$'
,
ItemViewPDate
.
as_view
(),
name
=
'item-purchase-date-view'
),
path
(
'fridge/<id>/add'
,
add_item
,
name
=
'add-item'
),
path
(
'fridge/<id>/<id2>/delete'
,
delete_item
,
name
=
'delete-item'
)
path
(
'fridge/<id>/<id2>/delete'
,
delete_item
,
name
=
'delete-item'
),
url
(
r'^to-buy/'
,
ToBuyViewName
.
as_view
(),
name
=
'to-buyLN'
)
]
if
settings
.
DEBUG
:
...
...
Breadcrumbs/views.py
View file @
94f0d60c
...
...
@@ -32,6 +32,14 @@ class ProductListViewCategory(ListView):
def
get_queryset
(
self
):
return
Product_Type
.
objects
.
filter
(
User_ID
=
self
.
request
.
user
)
.
order_by
(
'Product_Category'
)
class
ToBuyViewName
(
ListView
):
model
=
Product_Type
template_name
=
'placeholder-list.html'
context_object_name
=
'product'
def
get_queryset
(
self
):
return
Product_Type
.
objects
.
filter
(
User_ID
=
self
.
request
.
user
)
.
filter
(
To_Buy
=
True
)
.
order_by
(
'Product_Name'
)
def
login
(
request
):
username
=
"not logged in"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment