Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 6
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Patricia Isabella Nava
widget_group 6
Commits
dc3b5464
Commit
dc3b5464
authored
May 27, 2022
by
Pierre Ashley Salcedo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'salcedo/homepage'
parents
df549949
659e08f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
urls.py
widget_group_6/homepage/urls.py
+2
-1
views.py
widget_group_6/homepage/views.py
+9
-7
No files found.
widget_group_6/homepage/urls.py
View file @
dc3b5464
from
django.urls
import
path
from
django.urls
import
path
from
.
import
views
from
.
import
views
from
.views
import
HomepageView
app_name
=
"homepage"
app_name
=
"homepage"
urlpatterns
=
[
urlpatterns
=
[
path
(
""
,
views
.
index
,
name
=
"homepage"
),
path
(
""
,
views
.
HomepageView
.
as_view
()
,
name
=
"homepage"
),
path
(
"users/add/"
,
views
.
add
,
name
=
"add"
),
path
(
"users/add/"
,
views
.
add
,
name
=
"add"
),
path
(
"users/<int:user_id>/details/"
,
views
.
detail
,
name
=
"detail"
)
path
(
"users/<int:user_id>/details/"
,
views
.
detail
,
name
=
"detail"
)
]
]
\ No newline at end of file
widget_group_6/homepage/views.py
View file @
dc3b5464
from
django.shortcuts
import
redirect
,
render
from
django.shortcuts
import
redirect
,
render
from
django.http
import
Http404
,
HttpResponse
from
django.http
import
Http404
from
django.views
import
View
from
.models
import
WidgetUser
from
.models
import
WidgetUser
from
.forms
import
UserForm
from
.forms
import
UserForm
# Create your views here.
# Create your views here.
def
index
(
request
):
class
HomepageView
(
View
):
user_list
=
WidgetUser
.
objects
.
order_by
(
"last_name"
)
def
get
(
self
,
request
):
context
=
{
user_list
=
WidgetUser
.
objects
.
order_by
(
"last_name"
)
"user_list"
:
user_list
context
=
{
}
"user_list"
:
user_list
return
render
(
request
,
"homepage/index.html"
,
context
)
}
return
render
(
request
,
"homepage/index.html"
,
context
)
def
detail
(
request
,
user_id
):
def
detail
(
request
,
user_id
):
try
:
try
:
...
...
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