-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add separate version create view and create view URL #7595
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
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.
Seems simple enough 👍
I seem to recall @humitos having feedback on the URL structure, I'll wait for his feedback here. |
Found the conversation, it was here: #7594 (comment) My opinion is still that |
This is not currently used outside the new theme, but enables the solution for #6238 -- latest `master` of the new theme already expects this code. For now, the create URL does throw and exception, because we are rendering template code inside the version form. I'm not going to address this as the create view is not linked and unused, and we probably shouldn't be rendering templates inside form instantiation anyways. The edit version URL does change with this, to append the `/edit/` postfix. This was done to match similar URL patterns, and to give a path for the create view URL that does not match the edit URL pattern.
15e10c6
to
0fe01f6
Compare
The additional URL for the create view was causing errors with tests, so i did the more correct thing and made the URL conditional. Test look good now 👍 |
I don't want to block this work, but I made a comment with maybe a better explanation about why I think the It's not wrong using it, but I just find it easier to follow the conventions that Django and DRF are already using for these URLs. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is blocking continuing to work on templates so I'd like to get this merged. To resurrect this discussion, some added context: the reason for the
However, if we don't change the edit form URL to Using the If we want this to be even clearer, ProjectVersionDetail should really be ProjectVersionUpdate. This view is not a detail view at all, it is an admin only form view. I won't take this chunk on just yet, but can if it seems important to getting this merged. |
I don't think the URL's matter nearly as much for the dashboard as the API, so I'm fine with whatever is most obvious, and hopefully we can standardize on it. |
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 re-read the whole conversation and I think Anthony is right 😄
As an example of this, Django Admin uses:
/admin/auth/user/
to list all the users/admin/auth/user/add/
to create a new user/admin/auth/user/<pk>/change/
to edit a user
I understand that we are going to follow the same pattern but using /create/
and /edit/
instead of /add/
and /change/
, so 👍
This is not currently used outside the new theme, but enables the
solution for #6238 -- latest
master
of the new theme already expectsthis code.
For now, the create URL does throw and exception, because we are
rendering template code inside the version form. I'm not going to
address this as the create view is not linked and unused, and we
probably shouldn't be rendering templates inside form instantiation
anyways.
The edit version URL does change with this, to append the
/edit/
postfix. This was done to match similar URL patterns, and to give a path
for the create view URL that does not match the edit URL pattern.