[spyne] The helpfulness of logs, validation error contains no reference to the key

Alex ralienpp at gmail.com
Thu Jun 5 20:27:44 UTC 2014


Hi,


I gave it a try and it fails at startup, here is the output

```
DEBUG:spyne.interface._base:    adding class "<class
'spyne.model.primitive.Unicode'>" for
'{spyne.model.primitive}DataGetRequestNewTypeCreationList_statusType'
DEBUG:spyne.interface._base:    adding class "<class
'spyne.model.primitive.Unicode'>" for "{spyne.model.primitive}<class
'spyne.model._base.Empty'>"
Traceback (most recent call last):
  File "server.py", line 369, in <module>
    out_protocol=JsonDocument(ignore_wrappers=True),
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/application.py",
line 104, in __init__
    self.interface = Interface(self)
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 64, in __init__
    self.app = app
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 72, in set_app
    self.populate_interface()
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 288, in populate_interface
    self.add_class(cls)
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 391, in add_class
    self.add_class(v)
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 391, in add_class
    self.add_class(v)
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 391, in add_class
    self.add_class(v)
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 370, in add_class
    self.add_class(extends)
  File "/home/alex/neto/venv/local/lib/python2.7/site-packages/spyne/interface/_base.py",
line 358, in add_class
    assert not (cls.get_type_name() is cls.Empty)
AssertionError
```


This is the custom data type it doesn't like and the definitions it relies on

RequestStatus = Unicode(values=['new', 'processed'])


class RequestUnsigned(ComplexModel):
        pass

class DataGetRequestNewTypeCreationList(RequestUnsigned):
        operatorId = Uuid
        status = Array(RequestStatus)




Just in case, I'd like to make sure I set up the right thing, this is
what I did:
`pip install git+https://github.com/arskom/spyne.git`



Alex


More information about the people mailing list