Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
django-url-follower
Project
Project
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikolaos S. Papaspyrou
django-url-follower
Commits
fb2e8c4d
Commit
fb2e8c4d
authored
Jun 15, 2015
by
Nikolaos S. Papaspyrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit URL queries to current user
parent
6862efd3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
README.md
README.md
+3
-0
views.py
urlforward/views.py
+3
-2
No files found.
README.md
View file @
fb2e8c4d
...
@@ -43,6 +43,9 @@ from scratch, is found in the README file in branch `prepare`.
...
@@ -43,6 +43,9 @@ from scratch, is found in the README file in branch `prepare`.
Otherwise, just follow the commits, in exactly the order we
Otherwise, just follow the commits, in exactly the order we
showed them in the lab on Monday, June 15, 2015.
showed them in the lab on Monday, June 15, 2015.
In the lab, we went up to 6862efd3 but then I took the liberty
to continue a bit further.
---
---
Enjoy...
Enjoy...
...
...
urlforward/views.py
View file @
fb2e8c4d
...
@@ -11,7 +11,8 @@ from .models import Url
...
@@ -11,7 +11,8 @@ from .models import Url
@
login_required
@
login_required
def
index
(
request
):
def
index
(
request
):
context
=
{
context
=
{
'url_list'
:
Url
.
objects
.
all
()
'url_list'
:
Url
.
objects
.
filter
(
user__exact
=
request
.
user
)
.
order_by
(
'target'
)
}
}
return
render
(
request
,
'index.html'
,
context
)
return
render
(
request
,
'index.html'
,
context
)
...
@@ -24,7 +25,7 @@ def redir(request, url_id):
...
@@ -24,7 +25,7 @@ def redir(request, url_id):
@
login_required
@
login_required
def
details
(
request
,
url_id
):
def
details
(
request
,
url_id
):
context
=
{
context
=
{
'url'
:
get_object_or_404
(
Url
,
id
=
url_id
)
'url'
:
get_object_or_404
(
Url
,
id
=
url_id
,
user__exact
=
request
.
user
)
}
}
return
render
(
request
,
'details.html'
,
context
)
return
render
(
request
,
'details.html'
,
context
)
...
...
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