當前位置: 首頁>>代碼示例>>Python>>正文


Python main.ChangeList方法代碼示例

本文整理匯總了Python中django.contrib.admin.views.main.ChangeList方法的典型用法代碼示例。如果您正苦於以下問題:Python main.ChangeList方法的具體用法?Python main.ChangeList怎麽用?Python main.ChangeList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在django.contrib.admin.views.main的用法示例。


在下文中一共展示了main.ChangeList方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_changelist_instance

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist_instance(self, request):
        """
        Return a `ChangeList` instance based on `request`. May raise
        `IncorrectLookupParameters`.
        """
        list_display = self.get_list_display(request)
        list_display_links = self.get_list_display_links(request, list_display)
        # Add the action checkboxes if any actions are available.
        if self.get_actions(request):
            list_display = ['action_checkbox'] + list(list_display)
        ChangeList = self.get_changelist(request)
        return ChangeList(
            request,
            self.model,
            list_display,
            list_display_links,
            self.get_list_filter(request),
            self.date_hierarchy,
            self.get_search_fields(request),
            self.get_list_select_related(request),
            self.list_per_page,
            self.list_max_show_all,
            self.list_editable,
            self,
        ) 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:27,代碼來源:options.py

示例2: get_changelist

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist(self, request, **kwargs):
        """
        Returns the ChangeList class for use on the changelist page.
        """
        return AdminViewPermissionChangeList 
開發者ID:ctxis,項目名稱:django-admin-view-permission,代碼行數:7,代碼來源:admin.py

示例3: get_queryset

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_queryset(self, request):
        """
        Return a QuerySet of all model instances that can be edited by the
        admin site. This is used by changelist_view.
        """
        qs = self.model._default_manager.get_queryset()
        # TODO: this should be handled by some parameter to the ChangeList.
        ordering = self.get_ordering(request)
        if ordering:
            qs = qs.order_by(*ordering)
        return qs 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:13,代碼來源:options.py

示例4: get_changelist

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist(self, request, **kwargs):
        """
        Return the ChangeList class for use on the changelist page.
        """
        from django.contrib.admin.views.main import ChangeList
        return ChangeList 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:8,代碼來源:options.py

示例5: get_changelist

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist(self, request, model, modeladmin):
        if getattr(modeladmin, 'get_changelist_instance', None):
            return modeladmin.get_changelist_instance(request)

        return ChangeList(
            request, model, modeladmin.list_display,
            modeladmin.list_display_links, modeladmin.list_filter,
            modeladmin.date_hierarchy, modeladmin.search_fields,
            modeladmin.list_select_related, modeladmin.list_per_page,
            modeladmin.list_max_show_all, modeladmin.list_editable, modeladmin,
        ) 
開發者ID:silentsokolov,項目名稱:django-admin-rangefilter,代碼行數:13,代碼來源:tests.py

示例6: get_changelist_instance

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist_instance(self, request):
        """
        Return a `ChangeList` instance based on `request`. May raise
        `IncorrectLookupParameters`.
        """
        list_display = self.get_list_display(request)
        list_display_links = self.get_list_display_links(request, list_display)
        # Add the action checkboxes if any actions are available.
        if self.get_actions(request):
            list_display = ['action_checkbox'] + list(list_display)
        sortable_by = self.get_sortable_by(request)
        ChangeList = self.get_changelist(request)
        return ChangeList(
            request,
            self.model,
            list_display,
            list_display_links,
            self.get_list_filter(request),
            self.date_hierarchy,
            self.get_search_fields(request),
            self.get_list_select_related(request),
            self.list_per_page,
            self.list_max_show_all,
            self.list_editable,
            self,
            sortable_by,
        ) 
開發者ID:PacktPublishing,項目名稱:Hands-On-Application-Development-with-PyCharm,代碼行數:29,代碼來源:options.py

示例7: get_queryset

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_queryset(self, request):
        """
        Returns a QuerySet of all model instances that can be edited by the
        admin site. This is used by changelist_view.
        """
        qs = self.model._default_manager.get_queryset()
        # TODO: this should be handled by some parameter to the ChangeList.
        ordering = self.get_ordering(request)
        if ordering:
            qs = qs.order_by(*ordering)
        return qs 
開發者ID:Yeah-Kun,項目名稱:python,代碼行數:13,代碼來源:options.py

示例8: get_changelist

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist(self, request, **kwargs):
        """
        Returns the ChangeList class for use on the changelist page.
        """
        from django.contrib.admin.views.main import ChangeList
        return ChangeList 
開發者ID:Yeah-Kun,項目名稱:python,代碼行數:8,代碼來源:options.py

示例9: get_changelist

# 需要導入模塊: from django.contrib.admin.views import main [as 別名]
# 或者: from django.contrib.admin.views.main import ChangeList [as 別名]
def get_changelist(self, request, **kwargs):
        # This controls how the admin list view works. Override the
        # ChangeList to modify ordering, template, etc
        return CaseInsensitiveChangeList 
開發者ID:propublica,項目名稱:django-collaborative,代碼行數:6,代碼來源:admin.py


注:本文中的django.contrib.admin.views.main.ChangeList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。