Skip to content
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

Support for "weird" urls #40

Open
gervaso opened this issue Aug 31, 2012 · 1 comment
Open

Support for "weird" urls #40

gervaso opened this issue Aug 31, 2012 · 1 comment

Comments

@gervaso
Copy link

gervaso commented Aug 31, 2012

I'm trying to use slumber with the openbravo erp json api, which has some kind of inline query system within the query string.

The url is something like:
https://hostname/org.openbravo.service.json.jsonrest/PricingProductPrice/?_where=product.id='FBBE591D76204756A4E349FEF6E41D6D'

I've been able to call it using requests with the following parameters:
requests.get('https://hostname/org.openbravo.service.json.jsonrest/PricingProductPrice/?_where=product.id=\'FBBE591D76204756A4E349FEF6E41D6D\'')

Slumber instead seems to be escaping the quotes, so the url that I've tried does not work.
api.PricingProductPrice.get(_where='Product.id='FBBE591D76204756A4E349FEF6E41D6D'')

The request sent by slumber to the webserver is this:
org.openbravo.service.json.jsonrest/PricingProductPrice/?_where=Product.id%3D%27FBBE591D76204756A4E349FEF6E41D6D%27

while the correct one is this:
org.openbravo.service.json.jsonrest/PricingProductPrice/?_where=product.id='FBBE591D76204756A4E349FEF6E41D6D'

Do you think that such particular use cases could be supported by slumber? More examples of such queries are available on the openbravo website:

Thanks a lot for this powerful tool.

@merwok
Copy link
Contributor

merwok commented Jan 30, 2013

Doesn’t it work if you pass the query string parameters as keyword arguments? http://slumber.readthedocs.org/en/latest/tutorial.html#url-parameters

thing.get(_where='product=whatever') is valid Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants