Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sachith Fernando
2020-101
Commits
9adf5bf2
Commit
9adf5bf2
authored
Sep 24, 2020
by
LiniEisha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IT17098960 is committing from IT17100908 user's branch.
parent
6409bf74
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
3 deletions
+39
-3
AttendanceApp/api.py
AttendanceApp/api.py
+11
-0
AttendanceApp/urls.py
AttendanceApp/urls.py
+9
-3
AttendanceApp/views.py
AttendanceApp/views.py
+6
-0
FirstApp/templates/FirstApp/template.html
FirstApp/templates/FirstApp/template.html
+13
-0
No files found.
AttendanceApp/api.py
View file @
9adf5bf2
...
@@ -9,6 +9,8 @@ from rest_framework import status
...
@@ -9,6 +9,8 @@ from rest_framework import status
from
rest_framework.views
import
APIView
from
rest_framework.views
import
APIView
from
rest_framework.parsers
import
MultiPartParser
,
FormParser
from
rest_framework.parsers
import
MultiPartParser
,
FormParser
from
.
import
record
from
rest_framework.views
import
*
from
rest_framework.views
import
*
class
StudentAPIView
(
APIView
):
class
StudentAPIView
(
APIView
):
...
@@ -160,3 +162,12 @@ class FileView(APIView):
...
@@ -160,3 +162,12 @@ class FileView(APIView):
return
Response
(
file_serializer
.
errors
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
return
Response
(
file_serializer
.
errors
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
# this API will initiate the lecture
class
InitiateLecture
(
APIView
):
def
get
(
self
,
request
):
record
.
initiate
()
return
Response
({
"response"
:
"success"
})
AttendanceApp/urls.py
View file @
9adf5bf2
from
django.urls
import
path
from
django.urls
import
path
from
.api
import
student_list
,
student_detail
,
subject_list
,
subject_detail
,
attendance_list
,
StudentAPIView
,
StudentDetails
from
.api
import
student_list
,
student_detail
,
subject_list
,
subject_detail
,
attendance_list
,
StudentAPIView
,
\
StudentDetails
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
.api
import
FileView
from
.api
import
FileView
,
InitiateLecture
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
path
(
'students/'
,
student_list
),
path
(
'students/'
,
student_list
),
...
@@ -10,8 +12,12 @@ urlpatterns = [
...
@@ -10,8 +12,12 @@ urlpatterns = [
path
(
'subjects/<str:pk>'
,
subject_detail
),
path
(
'subjects/<str:pk>'
,
subject_detail
),
path
(
'attendance/'
,
attendance_list
),
path
(
'attendance/'
,
attendance_list
),
path
(
'student/'
,
StudentAPIView
.
as_view
()),
path
(
'student/'
,
StudentAPIView
.
as_view
()),
path
(
'initiate-lecture'
,
views
.
initiate_lecture
),
# class based
# class based
path
(
'student/'
,
StudentAPIView
.
as_view
()),
path
(
'student/'
,
StudentAPIView
.
as_view
()),
path
(
'student/<str:pk>'
,
StudentDetails
.
as_view
()),
path
(
'student/<str:pk>'
,
StudentDetails
.
as_view
()),
url
(
r'^upload/$'
,
FileView
.
as_view
(),
name
=
'file-upload'
)
url
(
r'^upload/$'
,
FileView
.
as_view
(),
name
=
'file-upload'
),
# this url will initiate the lecture
url
(
r'^process-initiate-lecture/$'
,
InitiateLecture
.
as_view
())
]
]
AttendanceApp/views.py
View file @
9adf5bf2
from
django.shortcuts
import
render
def
initiate_lecture
(
request
):
return
render
(
request
,
"AttendanceApp/Initiate_lecture.html"
)
\ No newline at end of file
FirstApp/templates/FirstApp/template.html
View file @
9adf5bf2
...
@@ -94,6 +94,19 @@
...
@@ -94,6 +94,19 @@
</div>
S
</div>
S
</li>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapseFour"
aria-expanded=
"true"
aria-controls=
"collapseThree"
>
<i
class=
"fas fa-fw fa-cog"
></i>
<span>
Attendance
</span>
</a>
<div
id=
"collapseFour"
class=
"collapse"
aria-labelledby=
"headingThree"
data-parent=
"#accordionSidebar"
>
<div
class=
"bg-white py-2 collapse-inner rounded"
>
<h6
class=
"collapse-header"
>
Components:
</h6>
<a
class=
"collapse-item"
href=
"/attendance/initiate-lecture"
>
initiate lecture
</a>
</div>
ac
</div>
S
</li>
<!-- Nav Item - Utilities Collapse Menu -->
<!-- Nav Item - Utilities Collapse Menu -->
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapseUtilities"
aria-expanded=
"true"
aria-controls=
"collapseUtilities"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapseUtilities"
aria-expanded=
"true"
aria-controls=
"collapseUtilities"
>
...
...
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