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

Failed to parse at: Token(type=':', value=':', lineno=1, index=4) on $select #1

Open
TO-TMuzaffarov opened this issue Aug 7, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@TO-TMuzaffarov
Copy link

TO-TMuzaffarov commented Aug 7, 2021

URL: /api/inventory/access-switches/?$select=description,uuid
odata_select = request.GET.get('$select')
queryset = apply_odata_query(queryset, odata_select)

Raises an issue:
odata_query.exceptions.ParsingException: Failed to parse at: Token(type=':', value=':', lineno=1, index=4)"

But same works for $filter as below
URL: /api/inventory/access-switches/?$filter=(contains(tolower(description), 'httrf'))

odata_filter = request.GET.get('$filter')
queryset = apply_odata_query(queryset, odata_filter)

@OliverHofkens OliverHofkens added the enhancement New feature or request label Aug 12, 2021
@OliverHofkens OliverHofkens self-assigned this Aug 12, 2021
@OliverHofkens
Copy link
Member

Hi @TO-TMuzaffarov,
unfortunately, $select is not yet supported at the moment.

I could definitely see this as the next feature to add, and I suppose it wouldn't be too difficult.
I'll have a crack at this soon and report back.

Thanks for your feedback!

@keul
Copy link

keul commented Oct 5, 2021

@OliverHofkens so: odata-query is in fact a parser just for $filter, isn't it?

@OliverHofkens
Copy link
Member

At the moment it is, yes. But I'm definitely planning on expanding support to the full OData spec in the future!

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

No branches or pull requests

3 participants