Here are the generic mixins we've been using a lot lately. If you have any that you find useful, feel free to send them to us in a pull request. Please include example usage.
Fork, make a change, update the docs, 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 --cov=braces --cov-report=html
- New 'abstract'
AccessMixinwhich provides overridable
get_redirect_field_name methodsfor all access-based mixins.
LoginRequiredMixinwhich provides same customization as other access mixins with
PrefetchRelatedMixin. Works the same as
SelectRelatedMixinbut uses Django's
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).
CsrfExemptMixinfor marking views as being CSRF exempt (from jarcoal).
- Some documentation updates and a spelling error correction (from shabda).
success_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
JSONResponseMixinto work with non-ASCII characters and other datatypes (such as datetimes)
- Fixed all mixins that have
raise_exceptionas an argument to properly raise a
PermissionDeniedexception to allow for custom 403s.