Skip to content
Snippets Groups Projects
Commit d02e1dbd authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-761: Fix to force all derived complexType's to add their type as an attribute

parent 03108ca7
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,14 @@ logger = logging.getLogger(__name__)
VERSION = "SIPlib 0.4"
ltasip.Namespace.setPrefix('sip')
# The LTA catalogue expectes all lofar complexType objects to be annotated as xsi:type="<my_type>"
# Trick pyxb into doing this, by override the _RequireXSIType, and make the xsitype required for out types.
import inspect
from pyxb.binding.basis import complexTypeDefinition
for member in inspect.getmembers(ltasip, inspect.isclass):
if issubclass(member[1], complexTypeDefinition):
member[1]._RequireXSIType = classmethod(lambda _1, _2: True)
# todo: create docstrings for everything.
# specify types and explain purpose of the field (-> ask someone with more astronomical background)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment