Skip to content

Commit

Permalink
修改列表页打开慢的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wgbbiao committed Jun 29, 2017
1 parent 782f91e commit 028cfd6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xadmin/plugins/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ def get_list_queryset(self, queryset):

# for clean filters
self.admin_view.has_query_param = bool(lookup_params)
self.admin_view.clean_query_url = self.admin_view.get_query_string(remove=
[k for k in self.request.GET.keys() if
k.startswith(FILTER_PREFIX)])
self.admin_view.clean_query_url = self.admin_view.get_query_string(remove=[k for k in self.request.GET.keys() if
k.startswith(FILTER_PREFIX)])

# Normalize the types of keys
if not self.free_query_filter:
Expand Down Expand Up @@ -157,7 +156,7 @@ def get_list_queryset(self, queryset):

try:
# fix a bug by david: In demo, quick filter by IDC Name() cannot be used.
if queryset and lookup_params:
if isinstance(queryset, models.query.QuerySet) and lookup_params:
new_lookup_parames = dict()
for k, v in lookup_params.iteritems():
list_v = v.split(',')
Expand All @@ -171,7 +170,7 @@ def get_list_queryset(self, queryset):
except Exception as e:
raise IncorrectLookupParameters(e)
else:
if not queryset:
if not isinstance(queryset, models.query.QuerySet):
pass

query = self.request.GET.get(SEARCH_VAR, '')
Expand Down

0 comments on commit 028cfd6

Please sign in to comment.