geex-arts / django-jet

Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo
https://github.com/jet-admin/jet-bridge
GNU Affero General Public License v3.0
3.56k stars 775 forks source link

Custom Dashboard shows empty Modules #233

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi,

if you setup a custom dashboard with some modules, e. g. AppList, ModelList, LinkedList, ..., the module instantiating with the argument models works only with the asterisk like this: models=('appname.*',). In case of explicit given model names like models=('appname.the_model',), the dashboard module remains empty. No models appear in the module.

The code snippet:

self.children.append(
    modules.AppList(
        title=_('User Management'),
        column=1,
        models=('auth.user', 'auth.group',),
    ),
)

The result on the dashboard:

applist
SalahAdDin commented 7 years ago

Can you make a trace back of this?

ghost commented 7 years ago

There's no stacktrace. I think its because of searching for the wrong key object_name in the lambda function of the init_with_context in modules.py.

Following line is implemented:

lambda model: self.models is None or ('%s.%s' % (app_name, model['object_name'])) in self.models or ('%s.*' % app_name) in self.models,

If I change it by replacing object_name with model_name, it works.

SalahAdDin commented 7 years ago

@f1nality, what do you think about it?

ghost commented 7 years ago

Hi @f1nality @SalahAdDin, any suggestions?

ghost commented 7 years ago

@f1nality @SalahAdDin bump!

SalahAdDin commented 6 years ago

@f1nality Hey!

Ismael-VC commented 6 years ago

Please come to the django-jet Discord server so we can organize if you like:

Welcome! 😄