classy-python/ccbv

Order methods by the call order

polarise opened this issue · 4 comments

Class based views appear to call methods in a particular order. The link below shows a 'method flowchart', which makes it easy to understand CBV.

https://docs.djangoproject.com/en/1.8/ref/class-based-views/base/

Could you please consider ordering methods in CCBV.co.uk in the order they are called prior to rendering the view?

Thanks.

PK

meshy commented

Hi @polarise,

That's an interesting idea, thanks. Our original plans for the site included graphs with this information, but we never really managed to come up with something workable.

I don't know how we could get that information using our current method of code inspection. We could of course populate the DB by hand, but I can't help but feel that that would be both time consuming and error prone. Perhaps there's a way that we could automate getting the information from the django docs with intersphinx (as we do for the documentation links)?

I am a little concerned that the "method flowchart" for View only lists three of the six methods we have listed on ccbv.

Yes, evidently the method flowcharts are incomplete. In fact, there aren't any method flowcharts for the other more complex views (otherwise I wouldn't have made this request).

Thanks for your reply, anyway.

A method flowchart would assume a linear flow through the methods, which there is not. I'm not convinced there's much merit. If you can draw an example of what it should look like then great.

meshy commented

Closing because I'm not sure what action we can take on this issue. If a new idea comes up, please open a new issue.