nested_admin package

Module contents

class NestedModelAdmin(model, admin_site)[source]

Bases: nested_admin.nested.NestedModelAdminMixin, django.contrib.admin.options.ModelAdmin

media
class NestedInlineModelAdmin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin, django.contrib.admin.options.InlineModelAdmin

media
class NestedGenericStackedInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericInlineModelAdminMixin

template = 'nesting/admin/inlines/stacked.html'
class NestedGenericTabularInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericTabularInlineMixin, django.contrib.contenttypes.admin.GenericInlineModelAdmin

media
class NestedInlineFormSet(*args, **kwargs)[source]

Bases: nested_admin.formsets.NestedInlineFormSetMixin, django.forms.models.BaseInlineFormSet

The nested InlineFormSet for the common case (ForeignKey inlines)

class NestedModelAdminMixin[source]

Bases: object

get_inline_formsets(request, formsets, inline_instances, obj=None, allow_nested=False)[source]
inline_admin_formset_helper_cls

alias of NestedInlineAdminFormset

render_change_form(request, context, obj=None, *args, **kwargs)[source]
class NestedStackedInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedStackedInlineMixin, django.contrib.admin.options.InlineModelAdmin

media
class NestedGenericTabularInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericInlineModelAdminMixin

template = 'nesting/admin/inlines/tabular.html'
class NestedGenericInlineModelAdmin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericInlineModelAdminMixin, django.contrib.contenttypes.admin.GenericInlineModelAdmin

media
class NestedInlineAdminFormsetMixin(inline, *args, **kwargs)[source]

Bases: object

classes = None
handler_classes
inline_formset_data()[source]
inline_model_id
media
class NestedTabularInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin

template = 'nesting/admin/inlines/tabular.html'
class NestedInlineModelAdminMixin(*args, **kwargs)[source]

Bases: object

fieldset_template = 'nesting/admin/includes/inline.html'
formset

alias of nested_admin.formsets.NestedInlineFormSet

get_formset(request, obj=None, **kwargs)[source]
get_formsets_with_inlines(request, obj=None)

Yields formsets and the corresponding inlines.

get_inline_instances(request, obj=None)
inlines = []
is_sortable = True
sortable_field_name = None
class NestedStackedInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin

template = 'nesting/admin/inlines/stacked.html'
class NestedTabularInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedTabularInlineMixin, django.contrib.admin.options.InlineModelAdmin

media
class NestedGenericInlineModelAdminMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin

formset

alias of nested_admin.formsets.NestedBaseGenericInlineFormSet

class NestedBaseGenericInlineFormSet(*args, **kwargs)[source]

Bases: nested_admin.formsets.NestedBaseGenericInlineFormSetMixin, django.contrib.contenttypes.forms.BaseGenericInlineFormSet

The nested InlineFormSet for inlines of generic content-type relations

class NestedInlineAdminFormset(inline, *args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineAdminFormsetMixin, django.contrib.admin.helpers.InlineAdminFormSet

class NestedGenericStackedInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericStackedInlineMixin, django.contrib.contenttypes.admin.GenericInlineModelAdmin

media

Subpackages

Submodules

nested_admin.compat module

A backport of the fix in Django 2.0 that retains the order of form media.

See https://github.com/django/django/commit/c19b56f633e172b3c02094cbe12d28865ee57772 and https://code.djangoproject.com/ticket/28377

exception MediaOrderConflictWarning[source]

Bases: exceptions.RuntimeWarning

class MergeSafeMedia(media=None, css=None, js=None)[source]

Bases: django.forms.widgets.Media

add_css(data)[source]
add_js(data)[source]
static merge(list_1, list_2)[source]

Merge two lists while trying to keep the relative order of the elements. Warn if the lists have the same two elements in a different relative order.

For static assets it can be important to have them included in the DOM in a certain order. In JavaScript you may not be able to reference a global or in CSS you might want to override a style.

compat_rel(f)[source]
compat_rel_to(f)[source]

nested_admin.exceptions module

exception NestedAdminPendingDeprecationWarning[source]

Bases: exceptions.PendingDeprecationWarning

nested_admin.formsets module

class FixDjango2MultipartFormMixin[source]

Bases: object

is_multipart(check_formset=True)[source]

Overridden is_multipart for Django 2.1 and 2.2 that returns the formset’s is_multipart by default.

check_formset : bool (default=True)
If False, returns the form’s original is_multipart value. Exists to prevent infinite recursion in the formset’s is_multipart lookup.
class NestedBaseGenericInlineFormSet(*args, **kwargs)[source]

Bases: nested_admin.formsets.NestedBaseGenericInlineFormSetMixin, django.contrib.contenttypes.forms.BaseGenericInlineFormSet

The nested InlineFormSet for inlines of generic content-type relations

class NestedBaseGenericInlineFormSetMixin(*args, **kwargs)[source]

Bases: nested_admin.formsets.NestedInlineFormSetMixin

save_existing(form, instance, commit=True)[source]

Saves and returns an existing model instance for the given form.

class NestedInlineFormSet(*args, **kwargs)[source]

Bases: nested_admin.formsets.NestedInlineFormSetMixin, django.forms.models.BaseInlineFormSet

The nested InlineFormSet for the common case (ForeignKey inlines)

class NestedInlineFormSetMixin(*args, **kwargs)[source]

Bases: object

get_queryset()[source]

TODO: document this extended method

get_saved_instance_for_form(form, commit, form_instances=None)[source]
is_multipart()[source]
is_nested = False
process_forms_pre_save(forms)[source]

Sort by the sortable_field_name of the formset, if it has been set, and re-index the form positions (to account for gaps caused by blank or deleted forms)

Allows customizable sorting and modification of self.forms before they’re iterated through in save().

Returns list of forms.

save(commit=True)[source]

Saves model instances for every form, adding and changing instances as necessary, and returns the list of instances.

save_existing_objects(initial_forms=None, commit=True)[source]

Identical to parent class, except self.initial_forms is replaced with initial_forms, passed as parameter.

save_new_objects(extra_forms=None, commit=True)[source]

Identical to parent class, except self.extra_forms is replaced with extra_forms, passed as parameter, and self.new_objects is replaced with new_objects.

get_base_polymorphic_model(ChildModel, allow_abstract=False)[source]
mutable_querydict(*args, **kwds)[source]

nested_admin.models module

nested_admin.nested module

class NestedModelAdmin(model, admin_site)[source]

Bases: nested_admin.nested.NestedModelAdminMixin, django.contrib.admin.options.ModelAdmin

media
class NestedModelAdminMixin[source]

Bases: object

get_inline_formsets(request, formsets, inline_instances, obj=None, allow_nested=False)[source]
inline_admin_formset_helper_cls

alias of NestedInlineAdminFormset

render_change_form(request, context, obj=None, *args, **kwargs)[source]
class NestedInlineAdminFormset(inline, *args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineAdminFormsetMixin, django.contrib.admin.helpers.InlineAdminFormSet

class NestedInlineModelAdmin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin, django.contrib.admin.options.InlineModelAdmin

media
class NestedStackedInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedStackedInlineMixin, django.contrib.admin.options.InlineModelAdmin

media
class NestedTabularInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedTabularInlineMixin, django.contrib.admin.options.InlineModelAdmin

media
class NestedInlineModelAdminMixin(*args, **kwargs)[source]

Bases: object

fieldset_template = 'nesting/admin/includes/inline.html'
formset

alias of nested_admin.formsets.NestedInlineFormSet

get_formset(request, obj=None, **kwargs)[source]
get_formsets_with_inlines(request, obj=None)

Yields formsets and the corresponding inlines.

get_inline_instances(request, obj=None)
inlines = []
is_sortable = True
sortable_field_name = None
class NestedGenericInlineModelAdmin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericInlineModelAdminMixin, django.contrib.contenttypes.admin.GenericInlineModelAdmin

media
class NestedStackedInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin

template = 'nesting/admin/inlines/stacked.html'
class NestedTabularInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin

template = 'nesting/admin/inlines/tabular.html'
class NestedGenericStackedInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericStackedInlineMixin, django.contrib.contenttypes.admin.GenericInlineModelAdmin

media
class NestedGenericTabularInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericTabularInlineMixin, django.contrib.contenttypes.admin.GenericInlineModelAdmin

media
class NestedGenericStackedInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericInlineModelAdminMixin

template = 'nesting/admin/inlines/stacked.html'
class NestedGenericTabularInlineMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericInlineModelAdminMixin

template = 'nesting/admin/inlines/tabular.html'
class NestedGenericInlineModelAdminMixin(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedInlineModelAdminMixin

formset

alias of nested_admin.formsets.NestedBaseGenericInlineFormSet

class NestedInlineAdminFormsetMixin(inline, *args, **kwargs)[source]

Bases: object

classes = None
handler_classes
inline_formset_data()[source]
inline_model_id
media

nested_admin.urls module

nested_admin.views module

server_data_js(request)[source]

Dynamic javascript serve defining the grappelli lookup urls.