Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
142a8042
Commit
142a8042
authored
May 31, 2017
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e5c4e4fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
views.cpython-35.pyc
sidtSite/catalog/__pycache__/views.cpython-35.pyc
+0
-0
views.py
sidtSite/catalog/views.py
+5
-1
No files found.
sidtSite/catalog/__pycache__/views.cpython-35.pyc
View file @
142a8042
No preview for this file type
sidtSite/catalog/views.py
View file @
142a8042
...
...
@@ -15,11 +15,15 @@ def index(request):
num_instances_available
=
BookInstance
.
objects
.
filter
(
status__exact
=
'a'
)
.
count
()
num_authors
=
Author
.
objects
.
count
()
# The 'all()' is implied by default.
# Number of visits to this view, as counted in the session variable.
num_visits
=
request
.
session
.
get
(
'num_visits'
,
0
)
request
.
session
[
'num_visits'
]
=
num_visits
+
1
# Render the HTML template index.html with the data in the context variable
return
render
(
request
,
'index.html'
,
context
=
{
'num_books'
:
num_books
,
'num_instances'
:
num_instances
,
'num_instances_available'
:
num_instances_available
,
'num_authors'
:
num_authors
},
context
=
{
'num_books'
:
num_books
,
'num_instances'
:
num_instances
,
'num_instances_available'
:
num_instances_available
,
'num_authors'
:
num_authors
,
'num_visits'
:
num_visits
},
)
...
...
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