Mixins for Django's class-based views.
Install from PyPI with pip:
pip install django-braces
Fork, make a change, update the docs, add/update tests, make a pull request.
Add yourself to CONTRIBUTORS.txt if you want.
All development dependencies are available in requirements.txt file.
To run the test suite, execute the following in your shell (Django install is required):
py.test tests/ --cov=braces --cov-report=html
- Removed
CreateAndRedirectToEditViewmixin. It was marked for deprecation and removal since 1.0. - Added
JsonRequestAndResponseMixinmixin which attempts to parse requests as JSON. - Added
CanonicalSlugDetailMixinmixin which allows for the specification of a canonical slug on aDetailViewto help with SEO by redirecting on non-canonical requests. - Tests and documentation changes for all of the above.
- Fix to allow
reverse_lazyon allAccessMixin-derived mixins.
FormValidMessageMixinwhich provides amessagesmessage when the processed form is valid.FormInvalidMessageMixinwhich provides amessagesmessage when the processed form is invalid.FormMessagesMixinwhich provides the functionality of both of the above mixins.GroupRequiredMixinwhich is a new access-level mixin which requires that a user be part of a specified group to access a view.
JSONResponseMixin.render_json_responsemethod updated to accept a status code.JSONResponseMixinaddedjson_dumps_kwargsattribute & get method to pass args to the json encoder.- New
OrderableListMixinallows ordering of list views by GET params. - Tests updated to test against latest stable Django release (1.5.1)
- Small fixes and additions to documentation.
- New 'abstract'
AccessMixinwhich provides overridableget_login_urlandget_redirect_field_name methodsfor all access-based mixins. - Rewritten
LoginRequiredMixinwhich provides same customization as other access mixins withlogin_url,raise_exception&redirect_field_name. - New
PrefetchRelatedMixin. Works the same asSelectRelatedMixinbut uses Django'sprefetch_relatedmethod. CreateAndRedirectToEditViewis marked for deprecation.PermissionRequiredMixinno longer requires dot syntax for permission names.- Marked package as supporting 2.6 thru 3.3 (from rafales).
- Fixes to documentation.
- Tests to cover new additions and changes.
- Tests for all mixins (from rafales).
- New
CsrfExemptMixinfor marking views as being CSRF exempt (from jarcoal). - Some documentation updates and a spelling error correction (from shabda).
SuccessURLRedirectListMixinraisesImproperlyConfiguredif nosuccess_list_urlattribute is supplied (from kennethlove).
- Try importing the built-in json module first, drop back to Django if necessary. Django 1.5 compatibility.
- Fixed signature of
UserFormKwargsMixin.get_form_kwargs - Updated
JSONResponseMixinto work with non-ASCII characters and other datatypes (such as datetimes) - Fixed all mixins that have
raise_exceptionas an argument to properly raise aPermissionDeniedexception to allow for custom 403s.



