Snippet List
When doing a list_filter on some object in the Django interface, every single item will be displayed. This is not always smart when very long list of choices can be displayed, even though the majority of these choices might not even exist in the database at all.
Using this script will only display a filtering possibility for those items actually present in the database.
This script is not generic, and you will need to change the lines noted "Change this", since I cannot know what exactly you need to filter.
There is possibly a way to make this completely generic, and I hope this will inspire someone to make it!
- admin-interface
- compact
- list_filter
When you switch you django project from 0.9.6 to 1.0, you can use this script to generate admin.py automatically.
You need copy cvt.py to the parent directory of your project(where your project lies) and type "python cvt.py <project> <app>". The admin.py will generated in the <project>/<app>(where it should be!).
Enjoy this small work!
- django
- python
- admin-interface
7 snippets posted so far.