django-typed-models
django-typed-models copied to clipboard
Abstract intermediary class
HI!
I've just read the issue here:
https://github.com/craigds/django-typed-models/issues/61
And it seems I am running into the same kind of problem.
I would like to achieve the following structure.
class BaseClass(TypedModel):
a = models.CharField(...)
class BaseClassWithFlavor(BaseClass):
class Meta:
abstract = True
b = models.CharField(...)
class Child1(BaseClassWithFlavor):
pass
class Child2(BaseClassWithFlavor):
pass
Which would result in both Child1 and Child2 having the "b" field.
Is that possible in anyway?
Thanks for the issue. This should work already I think, since it's the same situation as Child1 and Child2 both having an identical b field defined. And per the readme:
Fields defined on subclasses can only be defined on one subclass, unless the duplicate fields are exactly identical.
Presumably it's not working? Can you paste any error information you have?
Hi @craigds, thanks for the answer.
TypeError: Abstract base class containing model fields not permitted for proxy model 'Child1'.
This is the error that I get