Snippet List
The idea here is to wrap the original `delete_selected` functionality in a way that I shouldn't have to reimplement the templates (confirmation/error response) serving, just extend the original.
What this code does, it wraps the queryset's delete function with a closure, so when it really gets called (after the confirmation), it executes the extra functionality you wish to.
After looking at the original code, this seemed to be the most efficient way of doing it.
- admin
- wrap
- delete_selected
If you have long words (no spaces) that are so long that it's messing up your design, add a 0-width space in the word every X chars.
Usage:
Step 1. Inside your app's directory, create dir called 'templatetags'. In that directory, create a .py file (say 'app_extras.py'). Make sure you make this a python module, make an empty the init .py (with the 2 underscores on each side).
Step 2. Inside template (make sure app is on INSTALLED_APPS list in settings.py):
{% load app_extras %}
Step 3. Enjoy!
{{ some_long_word_with_no_breaks|zerowidthspace_separator:25 }}
- wordwrap
- wordbreak
- word-break
- long-words
- break
- long-lines
- wrap
- char-break
2 snippets posted so far.