dapper91 / pydantic-xml

python xml for humans
https://pydantic-xml.readthedocs.io
The Unlicense
155 stars 16 forks source link

Intellisense support for the parsed model #55

Closed desprit closed 1 year ago

desprit commented 1 year ago

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.

dapper91 commented 1 year ago

@desprit Hi. Fixed it in version 0.7.0.