modlinltd / django-advanced-filters

Add advanced filtering abilities to Django admin
https://pypi.org/project/django-advanced-filters/
MIT License
771 stars 173 forks source link

django 1.11.3: migration error 'has no attribute '_meta' #59

Closed letitfly closed 4 years ago

letitfly commented 7 years ago

File "/Users/cloud/src/django/cyq/env/lib/python2.7/site-packages/django/contrib/admin/decorators.py", line 28, in _model_admin_wrapper admin_site.register(models, admin_class=admin_class) File "/Users/cloud/src/django/cyq/env/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 104, in register if model._meta.abstract: AttributeError: type object 'AdminAdvancedFiltersMixin' has no attribute '_meta'

Looks like if I added the mixin to the model before do migration, it errors. But if I just migrate first and add the mixin later, it works. Nonetheless, it is a problem.

asfaltboy commented 5 years ago

Can you please paste the full definition and traceback?

Please note that AdminAdvancedFiltersMixin needs to be added to your ModelAdmin class and not to your Model .