Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patrys/django-scbv
Simple (and sane) class-based views for Django
https://github.com/patrys/django-scbv
Last synced: 20 days ago
JSON representation
Simple (and sane) class-based views for Django
- Host: GitHub
- URL: https://github.com/patrys/django-scbv
- Owner: patrys
- License: bsd-2-clause
- Created: 2011-07-08T18:27:31.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-07-24T13:39:07.000Z (over 13 years ago)
- Last Synced: 2024-10-04T19:42:47.203Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 94.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE
Awesome Lists containing this project
README
h1. Simple (and sane) class-based views for Django
What this packages provides can be described as class-based views done right.
* No assigning to @self@ outside of @__init__@.
* No mixins within mixins within mixins.
* App-like handlers for common tasksh2. Usage example
# 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'))),
)