airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [1/2] airavata-django-portal git commit: Using DefaultRouter which creates api root automatically
Date Thu, 21 Sep 2017 13:05:18 GMT
Repository: airavata-django-portal
Updated Branches:
  refs/heads/master 4147972a1 -> b82ebc11d


Using DefaultRouter which creates api root automatically


Project: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/commit/802f5560
Tree: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/tree/802f5560
Diff: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/diff/802f5560

Branch: refs/heads/master
Commit: 802f5560737101656ded7cf465d3f587d1708b8d
Parents: 4147972
Author: Marcus Christie <machrist@iu.edu>
Authored: Tue Sep 19 14:21:59 2017 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Tue Sep 19 14:21:59 2017 -0400

----------------------------------------------------------------------
 django_airavata/apps/api/serializers.py |  3 ---
 django_airavata/apps/api/urls.py        | 11 +----------
 2 files changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/802f5560/django_airavata/apps/api/serializers.py
----------------------------------------------------------------------
diff --git a/django_airavata/apps/api/serializers.py b/django_airavata/apps/api/serializers.py
index 12442dd..b2731b2 100644
--- a/django_airavata/apps/api/serializers.py
+++ b/django_airavata/apps/api/serializers.py
@@ -58,9 +58,6 @@ class ProjectSerializer(serializers.Serializer):
         instance.description = validated_data.get('description', instance.description)
         return instance
 
-    def get_username(self):
-        return self.context.request.user.username
-
 class ExperimentSerializer(serializers.Serializer):
 
     experimentId = serializers.CharField(read_only=True)

http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/802f5560/django_airavata/apps/api/urls.py
----------------------------------------------------------------------
diff --git a/django_airavata/apps/api/urls.py b/django_airavata/apps/api/urls.py
index 1c5e19b..7751b0e 100644
--- a/django_airavata/apps/api/urls.py
+++ b/django_airavata/apps/api/urls.py
@@ -9,23 +9,14 @@ import logging
 
 logger = logging.getLogger(__name__)
 
-router = routers.SimpleRouter()
+router = routers.DefaultRouter()
 router.register(r'projects', views.ProjectViewSet, base_name='project')
 
 app_name = 'django_airavata_api'
 urlpatterns = [
-    url(r'^$', views.api_root),
-    # url(r'^projects/$', views.ProjectList.as_view(), name='api_project_list'),
-    # More specific, longer URLs should come before less specific, shorter ones
-    # since the regular expression for project_id allows any character, even '/'
-    # url(r'^projects/(?P<project_id>.+)/experiments/$', views.ProjectExperimentList.as_view(),
name='api_project_experiments_list'),
-    # url(r'^projects/(?P<project_id>.+)/$', views.ProjectDetail.as_view(), name='api_project_detail'),
-    url(r'^experiments/$', views.ExperimentList.as_view(), name='api_experiment_list'),
     url(r'^', include(router.urls)),
 ]
 
 if logger.isEnabledFor(logging.DEBUG):
     for url in router.urls:
         logger.debug("router url: {}".format(url))
-
-urlpatterns = format_suffix_patterns(urlpatterns)
\ No newline at end of file


Mime
View raw message