Django "Mass Change" Admin Site Extension

Django Framework with its automatically generated admin site is quite a deal for any web developer when it comes to creating relatively simple applications in a very agile manner. In case you don’t know Django already I highly recommend reading about the project on its homepage – djangoproject.com and googling around a bit to get an idea of what it’s capable of. It looks relatively uncomplicated when compared to more popular frameworks like Ruby on Rails, Spring Framework, Symphony, Grails etc. yet I found both its design and implementation quite appealing. Among its most likable characteristics is undoubtedly the absence of non-Python configuration files and general lack of need of almost any configuration tweaks to start with (basically all you have to do to get running is provide your database credentials). As soon as you grasp the idea of what I’m talking about with this auto-generated admin site you can continue reading.

One of the most powerful parts of Django is the automatic admin interface. It reads metadata in your model to provide a powerful and production-ready interface that content producers can immediately use to start adding content to the site.

So you have this really neat admin interface which seems pretty much feature-complete, yet as your site grows more and more and you need to deal with lots of items at once, you’re almost sure to find it somewhat lacking. Sure you can select multiple objects and apply actions to them (e.g. built-in mass deletion action or mass-“whatever you’d like, just write the code yourself” action) but what you’d like to be able to do is mass-edit a certain set of fields of the selected items. And you don’t know the set in advance, you’d like to choose them on the fly. If you ever felt this way about Django Admin, here comes my quite recent piece of code – Django “Mass Change” Admin Site Extension. With DMCASE you’re going to be able to apply “Mass Change” action to any set of objects in your application and be redirected to a separate page where you can select which fields you’d like to be edited on all of them. A picture is worth a thousand words so here it goes:

Neat, right? 🙂 If you need this kind of functionality on your site I provide the source code of this extension on the terms of BSD License (same as Django itself), so basically you can do whatever you’d like with it as long you keep the copyright notice attached 😉

Here comes the real thing: Download DMCASE – Package. Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *