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

Potential compatibility issue / style improvement #81

Open
IvanAnishchuk opened this issue Jul 12, 2019 · 1 comment
Open

Potential compatibility issue / style improvement #81

IvanAnishchuk opened this issue Jul 12, 2019 · 1 comment

Comments

@IvanAnishchuk
Copy link

IvanAnishchuk commented Jul 12, 2019

render method on the main renderer is defined like this: def render(self, data, media_type=None, renderer_context={}, writer_opts=None): here which is both not how other renderers are defined and has a mutable object as a default value which is discouraged and could be dangerous.

I suggest we update it to something closer to other examples in DRF: def render(self, data, accepted_media_type=None, renderer_context=None). I'll prepare a PR if there are no volunteers or objections.

@IvanAnishchuk
Copy link
Author

While at it, streaming renderer's result is not displayed correctly in browsable api. Instead something like this is shown: <generator object CSVStreamingRenderer.render at 0x7f773d04ff10> perhaps some more sophisticated object can be used there, something that can be rendered into django template if needed but otherwise behaving like a generator?

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

1 participant