-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API endpoint to fetch all the properties at once #134
Comments
I agree this is important, specially for our use of PyPLN in mediacloud, but not only for that. I think it will be very useful for everyone. I would propose |
I Think these endpoints are pretty clear, but I think the one ending in On Mon, Sep 21, 2015 at 1:30 PM, Flávio Amieiro [email protected]
Flávio Codeço Coelho+55(21) 3799-5551 |
Just to document my recent findings: I've started implementing this in a branch but, as the commit message says, I've run into a problem. Values that work very well on their own, don't work at all when being rendered together. Another weird thing about this bug specifically is that some strings with non-ascii chars trigger it and others don't. I managed to isolate the keys that (when being rendered together with the other properties): 'contents', 'lemmas', 'palavras_raw' and 'semantic_tags'. When I remove these four keys from the returned data, it works. When I add it back, it gives me a UnicodeDecodeError. Also, automating tests for this has been hard, because of the way fixtures are right now. I decided to leave this untested for the time being since the next task is to remove MongoDict from the project. |
This code is ugly, but will be removed soon. Fixes NAMD#134
@fccoelho opened this issue in NAMD/pypln.api#40, but I'm migrating it here because it demands a change in pypln.web itself (which would be naturally followed by pypln.api).
"""
currently when we want to acess properties of a PyPLN documents, we need to fetch each on a separate request. This impractical.
There should be an diferent url to fetch the properties data.
For example today when we point the browser to a document properties url, such as this
http://fgv.pypln.org/documents/57894/properties/
we get back a json object with an array of property urls for that document:I propose we add a new API endpoint which could have the form of either:
http://fgv.pypln.org/documents/57894/properties_data/
or
http://fgv.pypln.org/documents/57894/properties/gzip
which would return a gzipped JSON with all the data.
"""
The text was updated successfully, but these errors were encountered: