Closed moluwole closed 6 years ago
I haven't dived into this part of the codebase but what exacly does the self.view
and `self.jsonz method?
Do they do any form of UI rendering? If not then the word, render
might not be best.
They do. self.view
renders the template using Jinja while self.json
sends JSON response
self.render_view
makes sense to me then.
But since the self.json
isn't rendering anything and just sending a JSON response then I'll advise you don't use the word render
. self.json
sounds right to me, similar to res.json
in express used for returning json responses.
self.view and self.json naming convention is quite ok ... I'm looking at the lengthy syntax when using the render word ...
:ok_hand:
True @wisdomanthoni
I was just about to share that. Especially considering PEP's rule of 80xters per line.
The main thing is that users understand and are able to discern what each method does by looking at the name.
Words of wisdom bro @wisdomanthoni 👌. We'll not change it. As long as the documentation points it out then user would be able to distinguish what it does truly @BolajiOlajide True! True!. :raised_hands:
Guys, what do you think of the following: Instead of
self.view()
to render view, we useself.render_view()
and instead ofself.json()
to render JSON object, we useself.render_json()
?