4

spyne.const has the following

REQUEST_SUFFIX = ''
"""The suffix for function response objects."""

RESPONSE_SUFFIX = 'Response'
"""The suffix for function response objects."""

How could I configure my own suffixes? I want all my methods' request names to be <method>RQ and responses to be <method>RS

Anton Egorov
  • 1,174
  • 1
  • 11
  • 21

1 Answers1

2

In theory, this should work right before instantiating your Application but just to be on the safe side, before the very first import from the spyne namespace, you should do this:

import spyne.const
spyne.const.REQUEST_SUFFIX ='RQ'
spyne.const.RESPONSE_SUFFIX ='RS'
Burak Arslan
  • 7,671
  • 2
  • 15
  • 24
  • It looks library monkey patching. Maybe we should be able to override settings (aka const) for `Service` or `Application` passing it as class metadata or any other way? – Anton Egorov Oct 29 '13 at 10:48
  • Yes but as of 2.10, that's the answer to your question. – Burak Arslan Oct 29 '13 at 11:35
  • It actually makes sense to pass them to the Application instance. I'd say introducing a ``spyne.config.Configuration`` object should be the best thing to do. – Burak Arslan Oct 29 '13 at 11:36