Re: ElementTree problem saving images

2019-11-07 Thread Nuno Vieira
Hi, thanks for your help. i solved the situation like this: img = props.find('images') photos = [] for child in img[:len(img)]: photos.append(child[0].text)

Re: ElementTree problem saving images

2019-11-06 Thread Integr@te System
Hi Issuer, Plz select options : 1. Follow someone else convert xml to dict, and then process forward. 2. See this document python DOM XML doc, especial in 20.6.2.3 section https://docs.python.org/3.6/library/xml.dom.html#domimplementation-objects see nodelist.item(i) and __getitem__() method. On

Re: ElementTree problem saving images

2019-11-06 Thread Nuno Vieira
Thanks for your feedback. The problem is if i set all the urls to None before, and a property have only 6 images of 20, on database saves the 6 images of this property and saves also the other image columns with images from a different property, but when i use the else blocks instead of setting

Re: ElementTree problem saving images

2019-10-24 Thread Arthur Antoine
The image urls are being set to None on every iteration where the id doesn't match. Try setting all of the urls to None before the loop, then remove the else blocks. On Thursday, October 24, 2019 at 11:28:00 AM UTC-4, Nuno Vieira wrote: > > Hi, > > i receive an xml file and i am parsing the valu

Re: ElementTree problem saving images

2019-10-24 Thread Jody Fitzpatrick
Would something like XMLTODICT help? https://pypi.org/project/xmltodict/ import xmltodict # Third Party data = "" parsed_data =xmltodict.parse(data) # do your data thing here... -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubsc