Hacker News new | comments | ask | show | jobs | submit login

django-vanilla-views in core for 1.7 please. ;-)

Thirded! This is a better implementation for a framework. CBGV as-is would be better as an add-on app.

This is a great example why framework projects could benefit from being a bit more democratic. Most people seem to be pulling their hair out, telling you something is too complicated to effectively use. The response: It's worth it once you learn. The complexity cost is worth it. Trust us. Read the docs (of course), use this 3rd party site (ok...), read the code. (so I can write a non-trivial view!?). If you are still giving that answer years later, you have to be open to the fact that that your users might be on to something.

Often when you hear someone say they're using CBGV on a large project, you can almost sense the pause for applause.

I use the class-based generic views in a couple of projects. My personal opinion is that the official documentation still needs work, because people end up in the API reference tree looking for the examples and explanations.

And that is not a happy place to end up when you're just starting out with them, since in there you're seeing the whole inheritance/mixin layout structure, which is what leads to the belief that it's too complicated to use.

Which... no, class-based generics are pretty darned easy. Here are the views for my blog app, for example:


It'd be nice to cut down the use of super(), but that's about the only issue I have with it. All of the simpler-CBV implementations I've seen make a few too many assumptions for my personal taste, or otherwise cut down on flexibility in favor of simplifying the inheritance diagram, which I don't agree with as a goal in itself.

Worth noting that it's an explicit aim of vanilla views to exactly replicate the functionality of Django's GCBVs.

For the docs: "If you believe you've found some behaviour in Django's generic class-based views that can't also be trivially achieved in django-vanilla-views, then please open a ticket, and we'll treat it as a bug."

You shouldn't be losing any flexibility by using it instead of using Django's existing GCBV implementation.

Was unaware of this project, thanks for bringing it up. Just about to begin a major project of my own, and it will definitely come in handy.

If anyone's interested in pushing that forward a good place to start would be this thread on the django-dev mailing list: https://groups.google.com/forum/#!searchin/django-developers...

I love vanilla-views. I would like to see the documentation expanded to discuss things that the django docs discuss: decorators for instance.

seconded :)

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact