Skip to content
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

Extension docstring magic #96

Closed
jayvdb opened this issue Jun 16, 2020 · 8 comments
Closed

Extension docstring magic #96

jayvdb opened this issue Jun 16, 2020 · 8 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Jun 16, 2020

When the user has overridden a view, they are very likely to change the serializer, and not copy the docstring.

It would be nice if the extension system here used the main view docstring, unless the replacement provided its own docstring.

@tfranzel
Copy link
Owner

actually i was under the impression that this was already being done. inspect.getdoc will follow the MRO until it finds a docstring. at least that is what i understood from a quick glance over the implementation.

can you give an example where this is not the case?

@jayvdb
Copy link
Contributor Author

jayvdb commented Jun 16, 2020

Is it being done on Fixed and/or Fixed.post ? It needs to be both.

@tfranzel
Copy link
Owner

that was the cruial piece of information. i'll have a look at the methods again. for the classes it should already work as expected

@tfranzel
Copy link
Owner

inspect.getdoc was used improperly. on fixing it, it gave too much though. i still need to stop the discovery on the DRF base classes, because it would otherwise emit the generic DRF documentation if there is do docstring on one's own classes. almost there

@jayvdb
Copy link
Contributor Author

jayvdb commented Jun 19, 2020

tfranzel added a commit that referenced this issue Jun 19, 2020
@tfranzel
Copy link
Owner

@jayvdb that is not enough to do it properly. check out this. i think that should solve your problem. please close if issue is resolved.

@tfranzel
Copy link
Owner

reopen if it does not work as expected

@jayvdb
Copy link
Contributor Author

jayvdb commented Jun 30, 2020

I cant re-open; I dont have permission to do that.

@jayvdb jayvdb mentioned this issue Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants