thanks for looking into this!
On Tue, Nov 30, 2010 at 9:22 PM, Bert Constantin <bert.co...@gmx.de> wrote:
>
> Hello Benjamin!
>
> > TypeError: Error when calling the metaclass bases
> > issubclass() arg 2 must be a class or tuple of classes
>
> From looking at the full traceback it seems that a custom manager
> is defined in a polymorphic model
> (probably Publication(DatedObject)).
Dang, I should have thought about mentioning that a custom Manager is
involved. Sorry.
> It would be interesting if you could replace the content of
> polymorphic/base.py with the content shown here:
> https://gist.github.com/722277
>
> You also should be able to download the file directly:
> wget https://gist.github.com/raw/722277/base.py
>
> This modified base.py just prints some more info about the affected
> model and manager (via sys.stderr.write) directly before the
> exception trace (three lines beginning with "# first user defined
> manager for model").
>
> Could you then post the result (these three lines)?
This is the output from ./manage.py shell
# first user defined manager for model "DatedObject":
# "objects": <polymorphic.manager.PolymorphicManager object at 0x299ad50>
# manager model: <class 'shared.models.DatedObject'>
# first user defined manager for model "Publication":
# "objects": <polymorphic.manager.PolymorphicManager object at 0x29a3190>
# manager model: <class 'publications.models.Publication'>
# first user defined manager for model "Publication":
# "objects": <polymorphic.manager.PolymorphicManager object at 0x2a2d7d0>
# manager model: None
> I'm also interested in the class definitions for the models
> Publication and DatedObject and for the custom manager.
> Could you post them (or send them via email)? Perhaps I can see
> something there that sheds more light onto this problem.
Sure, no problem. I shortened the class definitions for brevity's sake.
class PublishedManager(PolymorphicManager):
def get_query_set(self):
return super(PublishedManager, self).get_query_set().filter(publish=True)
class DatedObject(PolymorphicModel):
publish = models.BooleanField('publish', default=False)
objects = PolymorphicManager()
published = PublishedManager()
keywords = TaggableManager()
class Publication(DatedObject):
objects = PolymorphicManager()
batch = BatchManager()
BatchManager is from django-batch-select[1] and TaggableManager is
from django-taggit[2].
Thanks again for your time and great work!
Kind regards,
Benjamin
[1]: https://github.com/lilspikey/django-batch-select
[2]: https://github.com/alex/django-taggit
On Tue, Nov 30, 2010 at 10:44 PM, Benjamin Wohlwend <piqu...@gmail.com> wrote:
>
> Hi Bert,
>
> thanks for looking into this!
>
Did you per chance have time to look into this problem? Do you need
any more information from me?
Kind regards,
Benjamin