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


Python helpers.InlineAdminFormSet方法代碼示例

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


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

示例1: get_inline_formsets

# 需要導入模塊: from django.contrib.admin import helpers [as 別名]
# 或者: from django.contrib.admin.helpers import InlineAdminFormSet [as 別名]
def get_inline_formsets(self, request, formsets, inline_instances, obj=None):
        inline_admin_formsets = []
        for inline, formset in zip(inline_instances, formsets):
            fieldsets = list(inline.get_fieldsets(request, obj))
            readonly = list(inline.get_readonly_fields(request, obj))
            has_add_permission = inline._has_add_permission(request, obj)
            has_change_permission = inline.has_change_permission(request, obj)
            has_delete_permission = inline.has_delete_permission(request, obj)
            has_view_permission = inline.has_view_permission(request, obj)
            prepopulated = dict(inline.get_prepopulated_fields(request, obj))
            inline_admin_formset = helpers.InlineAdminFormSet(
                inline, formset, fieldsets, prepopulated, readonly, model_admin=self,
                has_add_permission=has_add_permission, has_change_permission=has_change_permission,
                has_delete_permission=has_delete_permission, has_view_permission=has_view_permission,
            )
            inline_admin_formsets.append(inline_admin_formset)
        return inline_admin_formsets 
開發者ID:PacktPublishing,項目名稱:Hands-On-Application-Development-with-PyCharm,代碼行數:19,代碼來源:options.py

示例2: get_inline_formsets

# 需要導入模塊: from django.contrib.admin import helpers [as 別名]
# 或者: from django.contrib.admin.helpers import InlineAdminFormSet [as 別名]
def get_inline_formsets(self, request, formsets, inline_instances,
                            obj=None):
        inline_admin_formsets = []
        for inline, formset in zip(inline_instances, formsets):
            fieldsets = list(inline.get_fieldsets(request, obj))
            readonly = list(inline.get_readonly_fields(request, obj))
            prepopulated = dict(inline.get_prepopulated_fields(request, obj))
            inline_admin_formset = helpers.InlineAdminFormSet(inline, formset,
                fieldsets, prepopulated, readonly, model_admin=self)
            inline_admin_formsets.append(inline_admin_formset)
        return inline_admin_formsets 
開發者ID:lanbing510,項目名稱:GTDWeb,代碼行數:13,代碼來源:options.py

示例3: get_inline_formsets

# 需要導入模塊: from django.contrib.admin import helpers [as 別名]
# 或者: from django.contrib.admin.helpers import InlineAdminFormSet [as 別名]
def get_inline_formsets(self, request, formsets, inline_instances, obj=None):
        inline_admin_formsets = []
        for inline, formset in zip(inline_instances, formsets):
            fieldsets = list(inline.get_fieldsets(request, obj))
            readonly = list(inline.get_readonly_fields(request, obj))
            prepopulated = dict(inline.get_prepopulated_fields(request, obj))
            inline_admin_formset = helpers.InlineAdminFormSet(
                inline, formset, fieldsets, prepopulated, readonly,
                model_admin=self,
            )
            inline_admin_formsets.append(inline_admin_formset)
        return inline_admin_formsets 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:14,代碼來源:options.py


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