-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
APIv3 refactor some fields #5868
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
Conversation
readthedocs/api/v3/serializers.py
Outdated
@@ -438,6 +450,10 @@ class Meta: | |||
'_links', | |||
] | |||
|
|||
def get_project_homepage(self, obj): | |||
# Overridden only to return ``None`` when the description is ``''`` |
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.
# Overridden only to return ``None`` when the description is ``''`` | |
# Overridden only to return ``None`` when the project homepage is ``''`` |
readthedocs/api/v3/serializers.py
Outdated
def get_project_homepage(self, obj): | ||
# Overridden only to return ``None`` when the description is ``''`` | ||
return obj.project_url or None | ||
|
||
def get_description(self, obj): |
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.
This should be removed right?
readthedocs/api/v3/serializers.py
Outdated
documentation = serializers.CharField(source='get_docs_url') | ||
project_homepage = serializers.SerializerMethodField() | ||
homepage = serializers.SerializerMethodField() |
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.
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.
home
is better than homepage
, as you said. Still not perfect, though. At least, is a little more clear and consistent with the WebUI.
I will use your suggestion.
Updated the PR with the feedback given. It's ready to re-review and merge. |
Lint issues are fixed in #5857 |
It's preferable to remove it now and re-add it later once we decide if it will be completely removed from DB or not.
099e038
to
ea3cade
Compare
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.
Makes sense 👍
urls.project_homepage
to the root of the Project objecturls
These changes make the object detail more clear, although I'm not sold on the name
urls
--I'd like to have something more related to "Read the Docs URLs" or "URLs under Read the Docs platform". Any suggestion here?Besides the above concern, I'd like to rename
project_homepage
to justhomepage
(once I get a better name forurls
) since it's a field of the project itself.