From 6f5784e516f2f523ce83ab3fe4e7dda9d7f6b602 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Mon, 28 Nov 2011 18:34:22 +0100 Subject: [PATCH] Add a setperson function to test complex function arguments --- examples/demo/demo.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/demo/demo.py b/examples/demo/demo.py index 42cda9b..a80db49 100644 --- a/examples/demo/demo.py +++ b/examples/demo/demo.py @@ -11,7 +11,7 @@ Then:: paster serve demo.cfg """ -from wsme import * +from wsme import WSRoot, expose, validate from wsme.wsgi import adapt import logging @@ -33,7 +33,6 @@ class DemoRoot(WSRoot): def helloworld(self): return u"こんにちは世界 (<- Hello World in Japanese !)" - @expose(Person) def getperson(self): p = Person() @@ -42,9 +41,15 @@ class DemoRoot(WSRoot): p.lastname = u'Geler' return p + @expose(Person) + @validate(Person) + def setperson(self, person): + return person + + def app_factory(global_config, **local_conf): root = DemoRoot() - + root.addprotocol('soap', tns='http://example.com/demo', typenamespace='http://example.com/demo/types',