You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know the question is three years old.
Nowadays it can be done by passing list of models to AdminController. Just replace admin = AdminController(model, DBSession, config_type=TGAdminConfig) in your RootController with
admin = AdminController(
[getattr(models, model_name)
for models in (model, app_model.plugged('name_of_plugged_app_here'))
for model_name in models.__all__],
DBSession,
config_type=TGAdminConfig)
And of course you also need to plug app with global_models=True option and do from tgext.pluggable import app_model above your RootController definition.
devilicecream
added a commit
to devilicecream/tgapp-registration
that referenced
this issue
Jan 5, 2018
Using as a reference the method provided in TurboGears/tgext.pluggable#13, to achieve compatibility with the admin panel all pluggables' models need to list the model classes they want to expose in the admin panel through `__all__`. Using inspection on the module should work as well, but this seems to me a cleaner (and more "pythonic") solution, even if it requires fixing all pluggables that don't already implement `__all__` in their models
I created a tgext.pluggable app with its db tables.
How can i get them on the default /admin panel ?
The text was updated successfully, but these errors were encountered: