dlamotte / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Default abstract model manager trumped by tagging manager... #264

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Consider this abstract model:

[code]

class Base(models.Model):

    # http://code.google.com/p/django-tagging/
    tags       = TagField()
    # ...

    class Meta:
        abstract = True

tagging.register(Base)

[/code]

Using above abstract model like so:

[code]

class Season(Base):
    #....

[/code]

When in the Python shell, and I do Season.objects.all(), I get an error 
(objects is not a property or something similar).

The fix is to add the below code to my abstract base class:

[code]

    # Need this here otherwise tagging will trump with its own manager:
    objects = models.Manager() # Admin uses this manager.

[/code]

Now my "Season" class has a default object manager.

Not sure if this is a feature of a bug, but I thought I would report it.

BTW, I love this code!!! Thanks so much for sharing it with the world! :)

Cheers,
Micky

Original issue reported on code.google.com by rgmi...@gmail.com on 15 Jun 2011 at 4:46