Django Yet Another Class Based View
django-yacbv (YetAnotherClassBasedView) is replacement of django’s CBV (django.views.generic.View).
Django’s View can only dispatch corresponds to request.method. but in many cases, it should consider more things, such as request parameter.
Django’s ClassBasedGenericView is inflexible, hard to remember it’s API and hard to understand succession inheritances.
Django’s View can’t remove decorators, this is necessary for testing. it forces us to test views with decorators, always it obstructs to pure unit testing.
As these solution, django-yacbv is released.
YACBV is simple
django-yacbv provide simple class based view, allowing user to create more flexible dispatching, like this:
from yacbv import View, view_config
class TopView(View):
@view_config(method='get',
param='flip',
template_name='top2.html')
def flipped(self, request):
return {'word': request.GET['flip']}
@view_config(method='get',
template_name='top.html')
def get(self, request):
return {'word': 'world'}
Notice about them:
The flip method will be dispatched only case that Request object contains flip parameter.
The template for each views can be specified as template_name argument of view_config.
These returned dictionary will be used as context for Template.
Now, django-yacbv is just pre-alpha library, not for production. If you like this package, check out it from Github!
Metadata
Release files for django-yacbv 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-yacbv-0.0.1.tar.gz | 4.1 kB | Without provenance | Details for django-yacbv-0.0.1.tar.gz |
Release files / django-yacbv-0.0.1.tar.gz
| Download URL | django-yacbv-0.0.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01a03f9a9a71330398d77dc6756a2776b77fcac1ca79d04177eb41c69cc23b0e
|
|
BLAKE2b-256 checksum How to use checksums |
0ab36cd5f5bb4150ba56b1c5883b6c0f6a3e835d42ad3b759b82f3f73a59e5e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-yacbv 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.