-
Notifications
You must be signed in to change notification settings - Fork 406
Implement Organization object refactor #747
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
Implement Organization object refactor #747
Conversation
120ddb5
to
3a33e62
Compare
self.login = org['login'] | ||
self._api = self.url = org['url'] | ||
|
||
def to_org(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
from .repos import Repository | ||
|
||
|
||
class Team(GitHubCore): | ||
class Team(models.GitHubCore): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
github3/orgs.py
Outdated
#: Various urls (not templates) | ||
for urltype in ('avatar_url', 'events_url', 'issues_url', | ||
'repos_url'): | ||
self.__setattr__(urltype, org[urltype]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have I done something to make setattr(self, urltype, org[urltype])
unusable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I just forgot that particular syntax. I have no excuse 😄
I have one question about the use of |
3a33e62
to
73a93a8
Compare
I fixed up |
Clean them up as done in sigmavirus24#680 for users.py Related-to: sigmavirus24#670 Signed-off-by: Jesse Keating <jkeating@j2solutions.net>
Alter how we import models as well, and fix a missing attribute on a call. Signed-off-by: Jesse Keating <jkeating@j2solutions.net>
This creates 3 new objects, one for iterations (Short), one for direct GETs (Organization), and one for events (EventOrganization). Most attributes can now be directly assigned, aside from a few that are only returned in the API if they are set on the server. Default those to None. Many test cassettes needed to be updated to pick up attributes added to orgs since the cassette was recorded (yay for additive REST APIs...). Introduce a 'auto_login' method to handle either token auth or username/password auth. Use it in the places I needed to update the cassette. Fix a few POST calls that were sending malformed (according to GitHub API) json data. Specifically an empty permission is not accepted. Related-to: sigmavirus24#670 Signed-off-by: Jesse Keating <jkeating@j2solutions.net>
73a93a8
to
181f08d
Compare
Rebased this after I merged the Projects API support. Just want to make sure that the CI passes before merging. :) |
🎉 Thank you! |
Splits Org into 3 objects, removes (most) of the None issues.
See commit messages for relevant info per-commit. Each commit should pass tests.
Related to #670