[chronojump-server] Enabling again the Gym page where the stations and exercises are shown
- From: Marcos Venteo Garcia <mventeo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump-server] Enabling again the Gym page where the stations and exercises are shown
- Date: Sun, 24 Jun 2018 19:31:06 +0000 (UTC)
commit 544708328d4b9969e176939d69ffdae692a1d87b
Author: Marcos Venteo García <marcos@Hoth.local>
Date: Sun Jun 24 21:28:28 2018 +0200
Enabling again the Gym page where the stations and exercises are shown
- Adding a class to retrive the stations by list
- Removing libmysqlclient-dev from Dockerfile
.gitignore | 2 ++
.../chronojump_networks/organizations/api/urls.py | 5 +++++
.../chronojump_networks/organizations/api/views.py | 12 ++++++++++++
.../templates/organizations/gyms/gym_detail.html | 2 +-
compose/local/django/Dockerfile | 2 +-
5 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3194520..3e4fde3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,8 @@ __pycache__/
# Distribution / packaging
.Python
+.envs
+.local
env/
build/
develop-eggs/
diff --git a/chronojumpserver-django/chronojump_networks/organizations/api/urls.py
b/chronojumpserver-django/chronojump_networks/organizations/api/urls.py
index e9c4342..7a20495 100644
--- a/chronojumpserver-django/chronojump_networks/organizations/api/urls.py
+++ b/chronojumpserver-django/chronojump_networks/organizations/api/urls.py
@@ -32,6 +32,11 @@ urlpatterns = [
view=views.GymStationsListView.as_view(),
name='gym_stations'
),
+ url(
+ regex=r'^(?P<organization_id>\d+)/(?P<gym_id>\d+)/stations/$',
+ view=views.StationsListView.as_view(),
+ name='list_stations'
+ ),
url(
regex=r'^(?P<organization_id>\d+)/station_exercises/$',
view=views.StationExercisesListView.as_view(),
diff --git a/chronojumpserver-django/chronojump_networks/organizations/api/views.py
b/chronojumpserver-django/chronojump_networks/organizations/api/views.py
index ea3e9b4..90b26b9 100644
--- a/chronojumpserver-django/chronojump_networks/organizations/api/views.py
+++ b/chronojumpserver-django/chronojump_networks/organizations/api/views.py
@@ -76,6 +76,18 @@ class GymStationsListView(ListAPIView):
print(serializer.data)
return Response(serializer.data)
+
+class StationsListView(ListAPIView):
+ """List exercises from station """
+ permission_classes = (IsAuthenticated, )
+ serializer_class = GymStationsSerializer
+
+ def get_queryset(self):
+ # Get as dictionary the data given from ajax
+ gym_id = int(self.kwargs['gym_id'])
+ gym = get_object_or_404(Gym, pk=gym_id)
+ return gym.stations.all()
+
class StationExercisesListView(ListAPIView):
"""List exercises from station """
permission_classes = (IsAuthenticated, )
diff --git a/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
b/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
index ef9ca7f..9cededd 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
@@ -58,7 +58,7 @@
lengthChange: false,
"ajax": {
"processing": true,
- "url" : "{% url 'api_organizations:gym_stations' organization_id=user.organization.id gym_id=gym.id
%}",
+ "url" : "{% url 'api_organizations:list_stations' organization_id=user.organization.id gym_id=gym.id
%}",
"dataSrc": ""
},
"columns": [
diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile
index 2009562..6941d3d 100644
--- a/compose/local/django/Dockerfile
+++ b/compose/local/django/Dockerfile
@@ -5,7 +5,7 @@ ENV C_FORCE_ROOT=1
# Install dependencies
RUN apt-get update \
-&& apt-get -y install python python-pip libmysqlclient-dev \
+&& apt-get -y install python python-pip \
# Gettext
&& apt-get -y install gettext \
# Pillow dependencies
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]