Skip to main content

Helpful mixins for Django View classes.

Project description

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.

Project details


Release history Release notifications

History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.1

History Node

1.0

This version
History Node

0.5b7

History Node

0.3a6

History Node

0.2.1a5

History Node

0.2a3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-viewclass-mixins-0.5b7.zip (10.3 kB) Copy SHA256 hash SHA256 Source None May 7, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page