[Pywps-dev] Fetching of POST data

Jachym Cepicky jachym.cepicky at gmail.com
Thu Apr 23 03:25:44 PDT 2015


This code come from Alex, and I have no clear idea why it is done like that

IMHO, rewrite as you feel is right. Alex is great Python programmer, but
does not look much deep into area of WPS, so this idea might be rigth in
general, but not necessary optimal for our usecase

čt 9. 4. 2015 v 14:15 odesílatel Calin Ciociu <calin.ciociu at gmail.com>
napsal:

> 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
>
> _______________________________________________
> pywps-dev mailing list
> pywps-dev at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/pywps-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pywps-dev/attachments/20150423/fcbb18fb/attachment.html>


More information about the pywps-dev mailing list