-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/entity attributes #3
Conversation
pyakeneo/result.py
Outdated
self._items, | ||
self._count, | ||
) = Result.parse_page(json.loads(r.text)) | ||
if r.status_code == requests.codes.ok: |
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.
requests
has a function for it
if r.status_code == requests.codes.ok: | |
if is_success(r.status_code): |
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.
I didn't find the method you suggest, instead I used the "ok" property
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.
oh, sorry, it's from DRF 😅
@@ -74,23 +88,46 @@ def get_self_link(self): | |||
def get_first_link(self): | |||
return self._link_first | |||
|
|||
@staticmethod | |||
def parse_page(json_data): | |||
@classmethod |
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.
Why this change if you don't use anything from cls
?
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.
In case some day someone decides to inherit this class and customize that method
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.
You can override a staticmethod too, but nevermind
No description provided.