django-pgtrigger
django-pgtrigger copied to clipboard
AttributeError in proxy models with multiple inheritance
Hello, we are getting the following error when adding a proxy model that extends more than 1 superclass.
if model_name is None:
> app_label, model_name = app_label.split('.')
AttributeError: type object 'SomeMixin' has no attribute 'split'
It can be reproduced with this kind of setup for instance. The model doesn't even need to specify triggers:
class BaseModel(models.Model):
pass
class SomeMixin:
pass
class ProxyModel(SomeMixin, BaseModel):
class Meta:
proxy = True
Running makemigrations
here will raise the error.
I created a fork with a fix https://github.com/g-nie/django-pgtrigger/tree/multibase-proxies
but I'm getting some test errors due to the fact that actual (weird) migration files are created in pgtrigger/tests/migrations
and I can't seem to work around that. If someone could give me some pointers on how to fix the tests, that would be great.
Then I can go ahead and open a PR.