diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 253: Move index and version view to a dedicated view module

Message ID 20111011103513.21793.59116.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Oct. 11, 2011, 10:35 a.m. UTC
------------------------------------------------------------
revno: 253
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Thu 2011-10-06 22:09:17 +0200
message:
  Move index and version view to a dedicated view module
added:
  lava_server/views.py
modified:
  lava_server/urls.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/urls.py'
--- lava_server/urls.py	2011-09-23 08:25:04 +0000
+++ lava_server/urls.py	2011-10-06 20:09:17 +0000
@@ -24,6 +24,7 @@ 
 from linaro_django_xmlrpc import urls as api_urls
 
 from lava_server.extension import loader
+from lava_server.views import index, version
 
 
 # Enable admin stuff
@@ -33,10 +34,8 @@ 
 # Root URL patterns
 urlpatterns = patterns(
     '',
-    url(r'^' + settings.APP_URL_PREFIX + r'$', direct_to_template,
-        name='lava.home', kwargs={'template': 'index.html'}),
-    url(r'^' + settings.APP_URL_PREFIX + r'version/$', direct_to_template,
-        name='lava.version_details', kwargs={'template': 'version_details.html'}),
+    url(r'^' + settings.APP_URL_PREFIX + r'$', index, name='lava.home')
+    url(r'^' + settings.APP_URL_PREFIX + r'version/$', version, name='lava.version_details'),
     url(r'^' + settings.APP_URL_PREFIX + r'accounts/', include('django.contrib.auth.urls')),
     url(r'^' + settings.APP_URL_PREFIX + r'admin/', include(admin.site.urls)),
     url(r'^' + settings.APP_URL_PREFIX + r'openid/', include('django_openid_auth.urls')),

=== added file 'lava_server/views.py'
--- lava_server/views.py	1970-01-01 00:00:00 +0000
+++ lava_server/views.py	2011-10-06 20:09:17 +0000
@@ -0,0 +1,29 @@ 
+# Copyright (C) 2010, 2011 Linaro Limited
+#
+# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
+#
+# This file is part of LAVA Server.
+#
+# LAVA Server is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License version 3
+# as published by the Free Software Foundation
+#
+# LAVA Server is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with LAVA Server.  If not, see <http://www.gnu.org/licenses/>.
+
+from django.views.generic.simple import direct_to_template
+
+
+def index(request):
+    return direct_to_template(
+        template='index.html')
+
+
+def version(request):
+    return direct_to_template(
+        template='version_details.html')