Django: Automatically adding all your models to the admin

I've been holding out with Django 0.96 for far too long, but I really like some of the changes in Django 1.0. One of them is moving the admin definitions out of models.py and into admin.py, which allows all kinds of neat tricks.

One of them is automatically adding all your models to the admin, for this add the following admin.py:

from django.contrib import admin
from django.contrib.contenttypes import generic
import models, inspect

l = [c[1] for c in inspect.getmembers(models) if inspect.isclass(c[1])]
for i in l:
    class Admin(admin.ModelAdmin):
        pass
    admin.site.register(i, Admin)

The inspect-line also shows how you can programmatically work with imported Python modules. I used to use a combination of dir() and eval(), which also works, but the above is much neater.

Funambol replaces BES as Zimbra replaces Exchange

Since setting up Zimbra, the email migration has gone quite well. The Outlook-connector works as expected and the more adventurous users are enjoying the fully-featured Zimbra web interface (which is much better than Outlook and Gmail, it could only be better if it made you lunch).

The next step is agenda and contact synchronization and sharing, especially on mobile phones.
Blackberry's are prolific among my client's employees, but not enough to go for a blackberry-only solution. I've looked into Blackberry Enterprise Server (BES), but the high costs and increased complexity made me look for other, simpler solutions. Zimbra does offer a web-based mobile client and a J2ME client, which are quite decent. Their Blackberry connector however requires a BES...

Installing Zimbra 5.0.13 on Debian Lenny, and migrating from Zarafa

My usual email-server setup includes postfix and dovecot, and works flawlessly. Recently, a client of mine was having problems with their in-house email server (based on Zarafa, that I had nothing to do with). They were used to server-side agenda/contacts in Outlook, so I gave Zimbra a try. Even though you have to pay for the "privilege" of full Outlook integration, it's a decent groupware package and I really like the web and admin interface.

Unfortunately, they currently (march '09) only support Debian Etch. I managed to install Zimbra on Lenny, but it wasn't pretty. Even so, here are the steps I took. YMMV.

Hosting virtual servers using Debian Lenny and Xen

The hype around virtual servers has quietened down and virtualization is becoming simply another tool in the sysadmin toolbox. Debian Lenny has made running instances in Xen even easier, but even so it isn't a no-brainer. For future reference, this is a quick list of steps for hosting virtual servers using static public IPs on Debian Lenny, using loopback files for containing the virtual server images.

Microsoft starts the new patent war

Yesterday with all the chaos around us, I nearly missed the new patent war that Microsoft has launched against Linux (the receiving end being TomTom).

After years of fighting via proxies (SCO vs IBM) and signing license agreements with various scared Linux distributions, Microsoft has finally openly struck their first blow using software patents against Linux. Some of the patents named are strictly related to car navigation ("Method and System for Generating Driving Directions") others can be tied directly to capabilities of Linux ("Common Name Space for Long and Short Filenames", "Method and System for File System Management Using a Flash-Erasable, Programmable, Read-only Memory"). How this case moves forward will determine the future of Linux/Microsoft interoperability (that Microsoft clearly doesn't want).

In the best case, this case will show that software patents are merely used for protecting monopolies and spark a reform of the US patent system. In the worst case, TomTom will have to pull out of the US market (or be forced to license these patents and pay a hefty fee) and Microsoft will get their club to use against any company using Linux in the US.

At least we in the EU are safe... for now. Even so, Neelie Kroes, are you watching this? These are anticompetitive actions from a company who promised to get their act together. I for one wouldn't mind waving Ballmer goodbye from the EU if TomTom is pushed out of the US.

Groklaw will now be able to open a new chapter in the legal battle between David and Goliath. May you live in interesting times.

Two crashes in one day

On a day where I fixed a crashed server, my girlfriend ended up being an on-site press-informer for the police during the airplane crash. On her second day as an intern at the police communications department!

(her blog is dutch, but she snapped a few photos of the disaster)

Syndicate content