Fix Django 1.5 metaclass retrieval (ref #166).