Update the demo to reproduce issue #3
This commit is contained in:
parent
17e113ea0f
commit
f2203742f9
@ -9,3 +9,6 @@ print client
|
||||
print client.service.Multiply(4, 5)
|
||||
print client.service.Helloworld()
|
||||
print client.service.Getperson()
|
||||
p = client.service.Listpersons()
|
||||
p = client.service.Setpersons(p)
|
||||
print p
|
||||
|
@ -14,6 +14,8 @@ Then::
|
||||
from wsme import WSRoot, expose, validate
|
||||
from wsme.wsgi import adapt
|
||||
|
||||
from six import u
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
@ -41,11 +43,30 @@ class DemoRoot(WSRoot):
|
||||
p.lastname = u'Geler'
|
||||
return p
|
||||
|
||||
@expose([Person])
|
||||
def listpersons(self):
|
||||
p = Person()
|
||||
p.id = 12
|
||||
p.firstname = u('Ross')
|
||||
p.lastname = u('Geler')
|
||||
r = [p]
|
||||
p = Person()
|
||||
p.id = 13
|
||||
p.firstname = u('Rachel')
|
||||
p.lastname = u('Green')
|
||||
r.append(p)
|
||||
return r
|
||||
|
||||
@expose(Person)
|
||||
@validate(Person)
|
||||
def setperson(self, person):
|
||||
return person
|
||||
|
||||
@expose([Person])
|
||||
@validate([Person])
|
||||
def setpersons(self, persons):
|
||||
return persons
|
||||
|
||||
|
||||
def app_factory(global_config, **local_conf):
|
||||
root = DemoRoot()
|
||||
|
Loading…
x
Reference in New Issue
Block a user