Open KMontag42 opened 12 years ago
Hey,
You are probably doing nothing wrong and have met one of the untested and apparently unsupported cases :(
_admin_opts
is monkey patched into the document by mongoadmin and provides a wrapper for mongoengine's meta dict because mongoengine's meta dict does not work with Django. As is get_field_by_name
which doesn't exist in mongoengine documents but is required by Django.
I hope I can take a look at inheritance this weekend. Sadly I don't have time sooner. Till then you can either write the patch yourself or live with inheritance being unsupported. Sorry.
No problem!
Temporarily, until I figure out a better way to deal with the issue, I've just left out the BaseActivity admin and it is working fine, I can view the other records no problem.
I may end up writing the patch myself, it depends on what else comes up this week. If I do I'll obviously post my changes.
Thanks!
Posting a patch would be nice!
Cheers.
Hey,
I'm trying to setup some inherited documents in my db, and I'm having some issues with viewing the base class in mongoadmin.
Here is my code: Admin.py:
Models.py:
This is the error I get when I try to go to /mongoadmin/activity/baseactivity: AttributeError at /mongoadmin/activity/baseactivity/ 'FanActivity' object has no attribute '_admin_opts'
Now, when I try to uncomment the _admin_opts attribute to the models, here is what I get: AttributeError at /mongoadmin/activity/baseactivity/ type object 'BaseActivity' has no attribute 'get_field_by_name'
What am I doing wrong??
Thanks for your help!