|
@@ -317,12 +317,13 @@ class AppList(DashboardModule):
|
|
|
app_to_remove = []
|
|
|
|
|
|
for app in app_list:
|
|
|
+ app_name = app.get('app_label', app.get('name', ''))
|
|
|
app['models'] = filter(
|
|
|
- lambda model: self.models is None or model['object_name'] in self.models or app.get('app_label', app.get('name')) + '.*' in self.models,
|
|
|
+ lambda model: self.models is None or ('%s.%s' % (app_name, model['object_name'])) in self.models or ('%s.*' % app_name) in self.models,
|
|
|
app['models']
|
|
|
)
|
|
|
app['models'] = filter(
|
|
|
- lambda model: self.exclude is None or model['object_name'] not in self.exclude and app.get('app_label', app.get('name')) + '.*' not in self.exclude,
|
|
|
+ lambda model: self.exclude is None or (('%s.%s' % (app_name, model['object_name'])) not in self.exclude and ('%s.*' % app_name) not in self.exclude),
|
|
|
app['models']
|
|
|
)
|
|
|
app['models'] = list(app['models'])
|
|
@@ -389,12 +390,13 @@ class ModelList(DashboardModule):
|
|
|
models = []
|
|
|
|
|
|
for app in app_list:
|
|
|
+ app_name = app.get('app_label', app.get('name', ''))
|
|
|
app['models'] = filter(
|
|
|
- lambda model: self.models is None or model['object_name'] in self.models or app.get('app_label', app.get('name')) + '.*' in self.models,
|
|
|
+ lambda model: self.models is None or ('%s.%s' % (app_name, model['object_name'])) in self.models or ('%s.*' % app_name) in self.models,
|
|
|
app['models']
|
|
|
)
|
|
|
app['models'] = filter(
|
|
|
- lambda model: self.exclude is None or model['object_name'] not in self.exclude and app.get('app_label', app.get('name')) + '.*' not in self.exclude,
|
|
|
+ lambda model: self.exclude is None or (('%s.%s' % (app_name, model['object_name'])) not in self.exclude and ('%s.*' % app_name) not in self.exclude),
|
|
|
app['models']
|
|
|
)
|
|
|
app['models'] = list(app['models'])
|