Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
fee7713e
Commit
fee7713e
authored
Sep 30, 2020
by
Matheus Miranda
Browse files
Merge branch 'develop' into 'master'
Update ActionsSerializer See merge request
!20
parents
2aad47bc
b26515e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
courses/stats/serializers.py
courses/stats/serializers.py
+14
-1
courses/stats/views.py
courses/stats/views.py
+1
-1
No files found.
courses/stats/serializers.py
View file @
fee7713e
...
@@ -54,6 +54,19 @@ class ActionSerializer(serializers.ModelSerializer):
...
@@ -54,6 +54,19 @@ class ActionSerializer(serializers.ModelSerializer):
date
,
hour
=
timestamp_str
.
split
()
date
,
hour
=
timestamp_str
.
split
()
return
date
+
' às '
+
hour
return
date
+
' às '
+
hour
def
get_accesible_area_name
(
self
,
name
):
accesible_areas
=
{
'Dashboard'
:
'Painel Inicial'
,
'Chat Main Page'
:
'Conversas'
,
'Profile Page'
:
'Página de perfil'
,
'Notes'
:
'Anotações'
,
'Classrooms'
:
'Salas'
,
'Courses'
:
'Lista de Espaços Formativos'
,
'Messages'
:
'Mensagens'
,
'Forums'
:
'Fóruns'
,
}
return
accesible_areas
.
get
(
name
,
name
)
def
get_object_type
(
self
,
obj
):
def
get_object_type
(
self
,
obj
):
if
isinstance
(
obj
,
Course
):
if
isinstance
(
obj
,
Course
):
return
' no curso '
+
obj
.
name
return
' no curso '
+
obj
.
name
...
@@ -64,7 +77,7 @@ class ActionSerializer(serializers.ModelSerializer):
...
@@ -64,7 +77,7 @@ class ActionSerializer(serializers.ModelSerializer):
if
isinstance
(
obj
,
Forum
):
if
isinstance
(
obj
,
Forum
):
return
' no fórum '
+
obj
.
title
return
' no fórum '
+
obj
.
title
if
isinstance
(
obj
,
AccessibleArea
):
if
isinstance
(
obj
,
AccessibleArea
):
return
' na área '
+
obj
.
name
return
' na área '
+
self
.
get_accesible_area_name
(
obj
.
name
)
return
''
return
''
def
get_action_phrase
(
self
,
obj
):
def
get_action_phrase
(
self
,
obj
):
...
...
courses/stats/views.py
View file @
fee7713e
...
@@ -74,7 +74,7 @@ class UserAccessView(views.APIView):
...
@@ -74,7 +74,7 @@ class UserAccessView(views.APIView):
class
ActivitiesPagination
(
PageNumberPagination
):
class
ActivitiesPagination
(
PageNumberPagination
):
page_size
=
5
0
page_size
=
3
0
page_size_query_param
=
'page_size'
page_size_query_param
=
'page_size'
max_page_size
=
100
max_page_size
=
100
...
...
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