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

Design Proposal: Move 'populate methods' to the parent objects from the Endpoints #24

Closed
t8y8 opened this issue Sep 9, 2016 · 1 comment

Comments

@t8y8
Copy link
Collaborator

t8y8 commented Sep 9, 2016

Today there are several properties that are unpopulated (views on workbooks, connections in workbooks) until you call a populate method.

That makes sense, it requires a new API call.

However, the logic is hidden up on the endpoint and not on the object itself. I think it's a little unintuitive.

Example:

_, wbs = server.workbooks.get()
wb = wbs.pop()
wb.name
>>> '1234-5678-123456'
wb.views
>>> UnpopulatedPropertyError

To get that populated you would call

server.workbooks.populate_views(wb)

But it feels a bit weird, because the method sort of implies I'm populating on the workbooks endpoint.

More naturally, it could be

wb.populate_views()
wb.views
>>> [<view obj>, <view obj>]

Or even call that automatically on access of wb.views for the first time

@irwando
Copy link
Contributor

irwando commented Jul 25, 2019

Old proposal which seems to have been implemented long ago.

@irwando irwando closed this as completed Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants