djangosnippets.org: Latest snippets tagged with 'mptt'https://djangosnippets.org/tags/mptt/2019-05-16T02:15:33.152889-05:00updated django-mptt enabled FilteredSelectMultiple m2m widget, Django 1.11 compatible
2019-05-16T02:15:33.152889-05:00RobertoMaurizzihttps://djangosnippets.org/snippets/10669/<p>Small fix to make https://www.djangosnippets.org/snippets/1779/ compatible with Django 1.11
To use this you'll also need the javascript from https://www.djangosnippets.org/snippets/1780/</p>
<p>I added an overridden optgroups method that can handle the additional tuple and a couple minor things I gathered while investigating for a fix (a default level_indicator of "+--" and changed …</p>
Freely redistributablejstree in change_list for mptt models
2010-02-25T02:55:19.078143-06:00pawnheartshttps://djangosnippets.org/snippets/1941/<p>to get code with all media files and setup.py:
hg clone http://code.tabed.org/mptt_admin/
<a href="http://tabed.org/static/mptt_admin2.jpg">screenshot</a></p>
Freely redistributabledjango-mptt enabled replacement for SelectBox.js
2009-11-05T03:53:10.604505-06:00anentropichttps://djangosnippets.org/snippets/1780/<p>This snippet is used in conjunction with the code in <a href="http://www.djangosnippets.org/snippets/1779/">#1779</a> to make an mptt-enabled version of the FilteredSelectMultiple widget.</p>
<p>See my blog for full details:
<a href="http://anentropic.wordpress.com/2009/11/05/more-django-mptt-goodness-filteredselectmultiple-m2m-widget/">http://anentropic.wordpress.com</a></p>
Freely redistributabledjango-mptt enabled FilteredSelectMultiple m2m widget
2009-11-05T03:38:22.804205-06:00anentropichttps://djangosnippets.org/snippets/1779/<p>If you are using django-mptt to manage content (eg heirarchical categories) then it needs a bit of help to make a nice admin interface. For many-to-many fields, Django provides the quite nice FilteredSelectMultiple widget (a two-pane selection list with search box) but it only renders 'flat' lists... if you have …</p>
Freely redistributableMPTTModelAdmin
2009-10-26T12:06:42.824017-05:00anentropichttps://djangosnippets.org/snippets/1775/<p>This builds on a couple of other people's hacks to effectively manage django-mptt models via the admin.</p>
<p>One problem you find is if you use the actions drop-down menu to ‘delete selected’ items from your mptt model… the bulk actions bypass the model’s delete method so your left/right values for …</p>
Freely redistributable