I'm experimenting with my xml files, was able to create a BaseXmlModel from etree.Element:
class Envelope(BaseXmlModel, tag="Envelope"):
body: Body = element(tag="Body")
def test_from_xml():
element = etree.fromstring(xml)
remove_namespaces(element)
record = Envelope.from_xml_tree(element)
I'm not getting autocompletion for the record object. For example I type record. and it doesn't suggest the body attribute. Not sure if it's something on my side or not. Since BaseXmlModel is inherited from pydantic BaseModel I was expecting intellisense support here.
I'm experimenting with my xml files, was able to create a BaseXmlModel from etree.Element:
I'm not getting autocompletion for the
record
object. For example I typerecord.
and it doesn't suggest thebody
attribute. Not sure if it's something on my side or not. Since BaseXmlModel is inherited from pydantic BaseModel I was expecting intellisense support here.