3

I've got a custom User object and a proxy model inheriting from it (zinnia's auther). The odd thing is that the proxy model seems to be overriding the managers model setting somehow. Goes something like this

 class CustomUserManager(BaseUserManager):
 ....

 class CustomUser(AbstractBaseUser, PermissionsMixin):
 ....

So far everything works fine, but after installing the zinnia plugin (https://github.com/Fantomas42/django-blog-zinnia/) containing the following

class Author(get_user_model()):
    """
    Proxy model around :class:`django.contrib.auth.models.get_user_model`.
    """

    objects = get_user_model()._default_manager
    published = EntryRelatedPublishedManager()

    ...

    class Meta:
        """
        Author's meta informations.
        """
        app_label = 'zinnia'
        proxy = True

After which the following happens: CustomUser.objects.model points to zinnia.models.author.Author

I'm guessing there's something going on in BaseManager.contribute_to_class(...). Any ideas?

twil
  • 6,032
  • 1
  • 30
  • 28
  • Could you provide usage example? – twil Nov 29 '13 at 11:14
  • For instance, any signal tied to the CustomUser object is not called. But I am able to get things running by commenting out the objects declaration in the proxy model, trying to see if that breaks anything. – user3049009 Nov 29 '13 at 12:22

0 Answers0