Skip to content

Commit f6c542a

Browse files
committed
SpyneView => DjangoView arskom#292
1 parent c76843d commit f6c542a

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spyne-2.11.0
2727
Sample response: ``{"ver":1, "fault": {"faultcode": "Server", "faultstring": "Internal Error"}}}``
2828

2929
* Steal and integrate the WebSocket tranport for Twisted.
30-
* Support Django natively using :class:`spyne.server.django.SpyneView` and
30+
* Support Django natively using :class:`spyne.server.django.DjangoView` and
3131
:class:`spyne.server.django.DjangoServer`.
3232
* It's now possible to override the ``JsonEncoder`` class ``JsonDocument`` uses.
3333
* Remove hard-coded utf-8 defaults from almost everywhere.

doc/source/manual/05-03_django.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ project/urls.py: ::
141141
configure_spyne()
142142
from spyne.application import Application
143143
from spyne.protocol.soap import Soap11
144-
from spyne.server.django import SpyneView
144+
from spyne.server.django import DjangoView
145145

146146
from project.todo.todolists import TodoService
147147

@@ -150,12 +150,12 @@ project/urls.py: ::
150150

151151
urlpatterns = patterns(
152152
'',
153-
url(r'^api/0.1/', SpyneView.as_view(application=api), name='api'),
153+
url(r'^api/0.1/', DjangoView.as_view(application=api), name='api'),
154154
)
155155

156156
First we configure spyne defaults. Then we create Spyne application that stores
157157
configuration for our setup. Finally we define view `api` bound to specific url.
158-
``SpyneView.as_view`` created for us :class:`spyne.server.django.DjangoServer`
158+
``DjangoView.as_view`` created for us :class:`spyne.server.django.DjangoServer`
159159
instance that will handle rpc requests.
160160

161161
Now we can run Django development server and look at WSDL that defines protocol

examples/django/rpctest/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030

3131
from django.conf.urls.defaults import patterns, include, url
3232
from spyne.protocol.soap import Soap11
33-
from spyne.server.django import SpyneView
33+
from spyne.server.django import DjangoView
3434
from rpctest.core.views import app, HelloWorldService
3535

3636

3737
urlpatterns = patterns('',
3838
url(r'^hello_world/','core.views.hello_world_service'),
39-
url(r'^say_hello/', SpyneView.as_view(
39+
url(r'^say_hello/', DjangoView.as_view(
4040
services=[HelloWorldService], tns='spyne.examples.django',
4141
in_protocol=Soap11(validator='lxml'), out_protocol=Soap11())),
42-
url(r'^api/', SpyneView.as_view(application=app)),
42+
url(r'^api/', DjangoView.as_view(application=app)),
4343
)

spyne/server/django.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def set_response(self, retval, response):
109109

110110

111111
class DjangoServer(HttpBase):
112-
113112
"""Server talking in Django request/response objects."""
114113

115114
def __init__(self, app, chunked=False):
@@ -246,8 +245,7 @@ def response(self, response, p_ctx, others, error=None):
246245
return response
247246

248247

249-
class SpyneView(object):
250-
248+
class DjangoView(object):
251249
"""Represent spyne service as Django class based view."""
252250

253251
application = None

spyne/test/interop/test_django.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _test_say_hello(self):
4141
self.assertEqual(list_resp,['Hello, Joe']*5)
4242

4343

44-
class SpyneViewTestCase(TestCase):
44+
class DjangoViewTestCase(TestCase):
4545
def test_say_hello(self):
4646
client = DjangoTestClient('/say_hello/', app)
4747
resp = client.service.say_hello('Joe', 5)

0 commit comments

Comments
 (0)