[Pywps-dev] Fetching of POST data

Jorge Samuel Mendes de Jesus jorge.mendesdejesus at wur.nl
Thu Apr 9 04:26:14 PDT 2015


Hi Calin


>From the back of my head.... the MultiDict preservers the order of the
entreated data and this sometimes can be important, BUT Multidict allows
for 1 identifer to return multiple contents see this example:

>>> d = MultiDict([('a', 'b'), ('a', 'c')])
>>> d
MultiDict([('a', 'b'), ('a', 'c')])
>>> d['a']
'b'
>>> d.getlist('a')
['b', 'c']




You maybe have complexdata that may have the same identifier (it is dumb
but may happen) and therefore it needs to be stored

I am not so certain about the StringIO, normally we use it to stream
string and this can be handy when dealing with big XML

J.


On 09-04-15 12:07, Calin Ciociu wrote:
> Hello everyone,
>
>
> Currently going through get_input_from_xml and was looking at the
> fetching of the complex data.
> StringIO is used for this purpose and I don't understand the idea
> behind it.
>
> The tests are also taking this in consideration and take the MultiDict
> with the StringIO of the complex data XML and do some assertions based
> on the tags after the parsing of the StringIO and getting an ElementTree.
>
>
> Isn't a Dictionary good enough for this purpose?
> And for what purpose does the MultiDict have to have the XML of the
> complex data and not only the actual data of the complex data?
>
>
> I was thinking of just doing a Dictionary inside a Dictionary for this
> matter.
> Something along the lines of:
>
> data = {}
>
> complex_data = {}
> complex_data['mimetype'] = 'text/foo'
> complex_data['value'] = ...lot of complex data...
>
> data['output1'] = complex_data
>
>
> Calin
> _______________________________________________
> pywps-dev mailing list
> pywps-dev at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/pywps-dev

-- 
ISRIC - World Soil Information 
Post: PO box 353, 6700 AJ, Wageningen,
The Netherlands Visiting Address: Droevendaalsesteeg 3, 6708 PB
Wageningen (Bdg. 101), 
Office: C.013 
Office Phone: +31 (0) 317 4 83715
Mobile Phone: +31 (0) 613 9 06950 
OpenPGPKey: 0xA3D0065A



More information about the pywps-dev mailing list