Simple (and sane) class-based views for Django
What this packages provides can be described as class-based views done right.
- No assigning to
- No mixins within mixins within mixins.
- App-like handlers for common tasks
# models.py class Parrot(models.Model): name = models.CharField(max_length=20)
# views.py from scbv import views from . import models class ParrotHandler(views.ModelHandler): model = models.Parrot success_url_create = 'parrot-created' success_url_update = 'parrot-updated' success_url_delete = 'parrot-deleted'
# urls.py from django.conf.urls.defaults import patterns, include, url from . import views urlpatterns = patterns('', url(r'^parrot/', include(views.ParrotHandler().get_urls(prefix='parrot-form'))), )