Add Singleton Support - #15
Conversation
Implement QuerySingle methods and classes to support singleton operations.
Fixes #14 |
tuomur
commented
Nov 22, 2017
Thanks for looking into this. Copying all of |
therealmitchconnors
commented
Nov 22, 2017
I have trimmed out all the functions that were not used by singletons (filter, top, skip, etc). I see that I could trim a bit more from the get_options and new_query functions where they relate to those operators to reduce the size of this feature, but I think the rest of the class is being used... With regard to the Entity subclass, what would that look like? With reference to the TripPin service, we would construct the Person entity, as well as a PersonSingle sublcass? How would we execute the query? Would the query return a Person entity or a PersonSingle entity? Thanks! |
tuomur
commented
Nov 23, 2017
I had a look at Singletons too, and ended up rewriting some of the EntitySet handling. Check it out at 9bfff03 (new branch) I tested this with the TripPin URL you mentioned. |
therealmitchconnors
commented
Nov 25, 2017
That looks promising. How would you go about using this model from the Service class? Something like |
tuomur
commented
Nov 27, 2017
Sorry, forgot to mention the usage changes :)
Service=ODataService('http://services.odata.org/TripPinRESTierService/', reflect_entities=True)
Me=Service.entities['Me']
me=Service.query(Me).first() |
therealmitchconnors
commented
Nov 28, 2017
I see, so singletons are effectively just an array of one? |
tuomur
commented
Feb 22, 2018
I merged my singleton branch to master. |
tpow
commented
Jan 21, 2019
This pull request can be closed. @tuomur implemented singleton support and merged it to master. |
Implement QuerySingle methods and classes to support singleton
operations.