Last active
December 6, 2016 12:37
-
-
Save edgabaldi/b4f8d42a38dc0a96ef6999107f0ae1c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _setup_changelist_queryset(self, params): | |
request = self.factory.get("/", params) | |
changelist = self._get_changelist(request, model, ma) | |
return changelist.get_query_set(request) | |
def _get_changelist(self, request, model, ma): | |
args = self._get_changelist_args(request, Leilao, self.ma) | |
return ChangeList(*args) | |
def _get_changelist_args(self, request, model, ma): | |
""" | |
Args necessários para instânciar o changelist do admin | |
""" | |
args = (request, model, ma.list_display, ma.list_display_links, | |
ma.list_filter, ma.date_hierarchy, ma.search_fields, | |
ma.list_select_related, ma.list_per_page, | |
ma.list_max_show_all, ma.list_editable, ma) | |
return args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment