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
24496d71
Commit
24496d71
authored
Mar 30, 2021
by
Julia Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an edit page for product types
parent
821c1f2d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
urls.py
Breadcrumbs/urls.py
+2
-1
views.py
Breadcrumbs/views.py
+7
-1
fridge-list.html
templates/fridge-list.html
+1
-1
No files found.
Breadcrumbs/urls.py
View file @
24496d71
...
@@ -4,7 +4,7 @@ from django.conf.urls.static import static
...
@@ -4,7 +4,7 @@ from django.conf.urls.static import static
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
from
django.urls
import
include
,
path
from
django.urls
import
include
,
path
from
Breadcrumbs
import
views
from
Breadcrumbs
import
views
from
.views
import
ProductListViewName
,
ProductListViewCategory
,
add_product_type
,
delete_product_type
,
ItemViewPDate
,
add_item
,
delete_item
,
ToBuyViewName
,
UnmarkToBuy
from
.views
import
ProductListViewName
,
ProductListViewCategory
,
add_product_type
,
delete_product_type
,
ItemViewPDate
,
add_item
,
delete_item
,
ToBuyViewName
,
UnmarkToBuy
,
editProductType
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^fridge/list/'
,
ProductListViewName
.
as_view
(),
name
=
'fridgeLN'
),
url
(
r'^fridge/list/'
,
ProductListViewName
.
as_view
(),
name
=
'fridgeLN'
),
...
@@ -17,6 +17,7 @@ urlpatterns = [
...
@@ -17,6 +17,7 @@ urlpatterns = [
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'
),
url
(
r'^to-buy/'
,
ToBuyViewName
.
as_view
(),
name
=
'to-buyLN'
),
path
(
'fridge/<int:pk>/update'
,
UnmarkToBuy
.
as_view
(),
name
=
'to-buy-unmark'
),
path
(
'fridge/<int:pk>/update'
,
UnmarkToBuy
.
as_view
(),
name
=
'to-buy-unmark'
),
path
(
'fridge/<int:pk>/edit'
,
editProductType
.
as_view
(),
name
=
'edit-product-type'
),
]
]
if
settings
.
DEBUG
:
if
settings
.
DEBUG
:
...
...
Breadcrumbs/views.py
View file @
24496d71
...
@@ -166,3 +166,9 @@ class UnmarkToBuy(UpdateView):
...
@@ -166,3 +166,9 @@ class UnmarkToBuy(UpdateView):
fields
=
[
'To_Buy'
]
fields
=
[
'To_Buy'
]
template_name
=
'unmark.html'
template_name
=
'unmark.html'
success_url
=
'http://127.0.0.1:8000/to-buy/'
success_url
=
'http://127.0.0.1:8000/to-buy/'
class
editProductType
(
UpdateView
):
model
=
Product_Type
fields
=
[
'Product_Name'
,
'Product_Category'
,
'Icon'
,
'To_Buy'
]
template_name
=
'unmark.html'
success_url
=
'http://127.0.0.1:8000/fridge/list'
\ No newline at end of file
templates/fridge-list.html
View file @
24496d71
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
</div>
</div>
<div
class =
"listEdit"
>
<div
class =
"listEdit"
>
<a
href =
"http://127.0.0.1:8000/fridge/{{product.Product_ID}}/
update
"
>
<a
href =
"http://127.0.0.1:8000/fridge/{{product.Product_ID}}/
edit
"
>
<div
class =
"black"
>
EDIT
</div></a>
<div
class =
"black"
>
EDIT
</div></a>
</div>
</div>
</div>
</div>
...
...
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