Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug by david: In demo, quick filter by IDC Name() cannot be used #411

Merged
merged 1 commit into from
Jun 23, 2017

Conversation

ghjan
Copy link

@ghjan ghjan commented Jun 20, 2017

fix a bug by david: In demo, quick filter by IDC Name() cannot be used

Description:
when I use demo, I found that quick list_quick_filter in HostAdmin can not work properly.
When you select IDC Name, no result is return because the filter do not work.
Root_cause:
the following sql is not correct:
WHERE "app_idc"."name" IN (idc1)

Solution:
So I modify xadmins/filter.py

        # fix a bug by david: In demo, quick filter by IDC Name() cannot be used.
        if queryset and lookup_params:
            new_lookup_parames = dict()
            for k, v in lookup_params.iteritems():
                list_v = v.split(',')
                if len(list_v) > 0:
                    new_lookup_parames.update({k: list_v})
                else:
                    new_lookup_parames.update({k: v})
            queryset = queryset.filter(**new_lookup_parames)

@wgbbiao wgbbiao merged commit 97ed16d into sshwsfc:django1.11 Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants