Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Create subproject relationship via APIv3 endpoint #6176
The main goal of this PR is to add the ability to create a subproject relationship between two
This PR is based on #5952 (https://github.com/readthedocs/readthedocs.org/tree/humitos/apiv3/project-update-endpoint) because it needs the "per object permissions check" changes that PR contains.
There are some things to note about this PR:
As a side note, while working on the tests for this PR, I found a but in the
`self` is either ChildRelatedProjectQuerySet or ParentRelatedProjectQuerySet. None of these one has a `project` field. Because of this, we need to use `self.project_field` for lookup.
stsewd left a comment •
I think you are missing some more checks:
I think 1 and 3 should be done at the db level.
Also, do we allow to add translations? There are some similar checks to be done too.
Hmm, I think I would be easier on users to have the current default as an option, but also the option to pass a param to delete all subprojects with the top-level project too.
Let's say I intentionally want to delete a project and its 100 subprojects. With the current default I then have to do 100 more API operations to delete each (new) top-level project. Doable, but tedious.
I added these checks and tests for them as well. Please, review the PR when you have some time.
Currently, no. We are only listing translations under