Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Fix docs multiple nested and multiple methods#5334
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carltongibson commentedAug 15, 2017
This is looking good. Thanks! I'll review fully this week. |
| defschema_links(section,sec_key=None): | ||
| """ | ||
| Recursively find every link in a schema, even nested. | ||
| """ |
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.
Is this going to be valid when used as an HTMLid attribute?
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.
works fine in firefox and chrome under debian x64
e.g:http://localhost:8000/docs/#users-animals > dogs > list
also clicking the links on the sidebar work.
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.
What about for the JavaScript data binding inhttps://github.com/encode/django-rest-framework/blob/master/rest_framework/templates/rest_framework/docs/interact.html#L19 ?
carltongibson commentedAug 16, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@woile I think this is great! 💃🏼 I like the Tests: The examples you've give seem to cover the core cases. Can you turn them into |
carltongibson commentedAug 16, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
My only question is (inline above) about the JavaScript data-binding — does that break? (I found it did working around this in a worse way (comment) in#5077) If so returning an What do you think? |
carltongibson commentedAug 16, 2017
I'm sure it'll work for some clients but break in others. Not conclusive but my mail client makes a mess of it: I think we should adjust this for robustness sake. 🙂 |
woile commentedAug 16, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@carltongibson for the ID's maybe we could use theslugify from django which will convert spaces to hiphens. That'd be a solution to deal with the id related problems, right? I'll try to make the unittests tomorrow. |
carltongibson commentedAug 17, 2017
Great. Thanks! I think tests at the |
woile commentedAug 17, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@carltongibson I fixed the issues you suggested, tell me what you think. The generated ID for links now looks like this: And the interaction modal works fine (note: I added a normalize function over the I'll be working on the tests now. |
carltongibson commentedAug 17, 2017
@woile — Looking AWESOME! Thanks for the effort!!! (If we can get the tests in place, I think we can get this in.) |
woile commentedAug 17, 2017
@carltongibson I've added the tests, tell me what you think. They are a bit long, but the cases are long as well :P |
carltongibson commentedAug 18, 2017
@woile The test cases look great. I'll give this a final review today. Thank you for you effort! |
carltongibson commentedAug 18, 2017
@woile This is good work: it passes my manual testing. 🙂 I'm going to pull this in. Thanks again! |
woile commentedAug 18, 2017
@carltongibson you are welcome, no problem at all! Glad to help |

Uh oh!
There was an error while loading.Please reload this page.
Description
Multiple nested resources with multiple methods were not displayed. Also
detail_routesandlist_routeswith multiple methods. This PR attempts to fix it.I created a template tag, thatrecursively finds the links inside a given section. What do you guys think?
I am not sure if the format I've given to the generated links it's okay, but it's a start.
Issues related:
#5324
#4391
#4965
Results
Default actions
Single action
Single detail_route url
More than one detail_route url
Nested routes
Multiple resources with nested schema
Multiple list_route url
Single list_route url (houses)