Provides some common mixin patterns for Django’s View classes.
Installation
Run pip install django-viewclass-mixins
View Mixins
###LoginMixin Ensures the view is being requested by an authenticated user or redirects to the login page. It behaves the same as the function decorator login_required.
###StaffRequiredMixin Ensures the view is being request by an authenticated user that is marked as staff.
###SuperuserRequiredMixin Ensures the view is being request by an authenticated user that is marked as a superuser.
###OwnershipMixin A mixin to single-object views. Ensures the view is by requested by the owner of the requested object.
###DeactivateMixin A mixin to the DeleteView. Instead of deleting an object it will mark it as inactive instead.
###FilterListMixin A mixin to the ListView. It will apply filters from the URL querystring to the underlying QuerySet before the list is returned.
###ModelFormSetMixin A mixin to the CreateView and UpdateView. It take a list of FormSets and validates and saves them along with the main model.
###HttpCacheMixin A mixin to any View. It has methods for setting HTTP cache headers like Cache-Control, Vary, ETag, and Last-Modified.
###CorsMixin A mixin to a Django Rest Framework View. It sets permissive CORS headers and handles the OPTIONS response.
Metadata
Release files for django-viewclass-mixins 1.1.3
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 | |
|---|---|---|---|---|
| django-viewclass-mixins-1.1.3.zip | 10.8 kB | Without provenance | Details |
Release files / django-viewclass-mixins-1.1.3.zip
| Download URL | django-viewclass-mixins-1.1.3.zip |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b242f4bdf76e5b7d818f203706393c2704c9862dc7ae610a66ee3a4b3b5589df
|
|
BLAKE2b-256 checksum How to use checksums |
6c28cba8a6a7f4dcb20b5c2c7df7c89c2f32ec1384db8893af74533d76cd43c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-viewclass-mixins 1.1.3
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.