[Pywps-dev] Fetching of POST data

Calin Ciociu calin.ciociu at gmail.com
Thu Apr 9 05:15:43 PDT 2015


Hello Jorge,

I looked at MultiDict and saw the benefit.
Only thing is that in the GET if the client specifies twice the same 
input identifier it results in taking the last one.
PyWPS 3 was doing the same, taking the later one and so overwriting the 
first occurrence.


Another thought of mine was fetching and storing every complex and 
literal data, no matter if GET or POST in the same manner using either a 
dictionary inside of a dictionary to keep the order of data or MultiDict 
which does exactly the same.

Calin

On 04/09/2015 01:26 PM, Jorge Samuel Mendes de Jesus wrote:
> 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



More information about the pywps-dev mailing list