From 3a4a1f083f09998c380d5548f47066bad61aef40 Mon Sep 17 00:00:00 2001 From: Jairus Martin Date: Wed, 26 Mar 2014 10:45:20 -0400 Subject: [PATCH] Added ability to select specific fields --- xadmin/plugins/ajax.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xadmin/plugins/ajax.py b/xadmin/plugins/ajax.py index 2378ca300..bdab081c1 100644 --- a/xadmin/plugins/ajax.py +++ b/xadmin/plugins/ajax.py @@ -19,7 +19,10 @@ class AjaxListPlugin(BaseAjaxPlugin): def get_result_list(self, response): av = self.admin_view - base_fields = av.base_list_display + if '_fields' in self.request.GET: + base_fields = self.request.GET['_fields'].split(',') + else: + base_fields = av.base_list_display headers = dict([(c.field_name, force_unicode(c.text)) for c in av.result_headers( ).cells if c.field_name in base_fields])