-
Notifications
You must be signed in to change notification settings - Fork 93
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
the method select of ODataQuery classes should handle iterable parameters #71
Comments
It should be easy to fix but I want to refactor the code to avoid duplication. .select(','.join(['Bukrs', 'Recntype', 'Recntxt']) PS: Would it be possible to stop communicating via Word and screenshots? I do not have MS Office and screenshots do not allow searching and copying. GitHub allows you to format issues and include pictures (I don't ask for them, I just state it is possible) - https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax |
Developer notes: def select(self, select):
"""Sets the selection clauses."""
- self._select = select
+ if isinstance(select, str):
+ self._select = select
+ elif isinstance(select, (list, tuple, set)):
+ self._select = ','.join(select)
+ but we have 2 selects:
|
Event smarter solution would be: - def select(self, select):
+ def select(self, *select):
"""Sets the selection clauses."""
- self._select = select
+ if not select or select[0] is None:
+ self._select = None
+ return
+
+ for i, select_member in enumerate(select):
+ if isinstance(select, (list, tuple, set)):
+ select[i] = ','.join(select_member)
+
+ self._select = ','.join(select)
+
return self |
Thanks for the prompt response, Jakub. |
@amosang Good catch. Could you file a new issue, please? |
The generated URL for $select is faulty for a list of properties, and only gives the last property specified. Please see attached Word document for details.
Problem with generated $select HTTP parameter.docx
The text was updated successfully, but these errors were encountered: