Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abstract base class supported? #22

Open
guettli opened this issue Jul 10, 2014 · 4 comments
Open

abstract base class supported? #22

guettli opened this issue Jul 10, 2014 · 4 comments

Comments

@guettli
Copy link

guettli commented Jul 10, 2014

I tried to use an AbstractBase class which uses TypedModel, but this fails:

class AbstractBase(typedmodels.TypedModel):

    class Meta:
        abstract=True
  File "/home/foo_eins_dtg/src/foo/foo/models/config.py", line 64, in <module>
    class AbstractBase(typedmodels.TypedModel):
  File "/home/foo_eins_dtg/lib/python2.7/site-packages/typedmodels/models.py", line 231, in __new__
    if not cls._default_manager:
AttributeError: type object 'AbstractBase' has no attribute '_default_manager'

Is this supported?

All models which inherit from this AbstractBase should have each its own table.

@ccdavid
Copy link

ccdavid commented Jan 23, 2015

Same issue here. Any updates?

@cdvv7788
Copy link

This is a limitation on django itself. Whenever you create an abstract model only its subclasses have access to the manager (.objects) due to the fact that the model does not have a table, so you can't access the full set of instances like in multi-table inheritance, where parent has a table and maps the childs with an one to one relationship.

@JVanloofsvelt
Copy link

I too, like guetti, expected this to work. Wouldn't this be a nice feature?

@tom-zeit
Copy link

tom-zeit commented Jul 1, 2016

👍 for this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants