nested_admin.tests.gfk package

Submodules

nested_admin.tests.gfk.admin module

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

Bases: nested_admin.nested.NestedGenericStackedInline

extra = 0
inline_classes = ('collapse', 'open', 'grp-collapse', 'grp-open')
inlines = [<class 'nested_admin.tests.gfk.admin.GFKBInline'>]
media
model

alias of nested_admin.tests.gfk.models.GFKA

sortable_field_name = 'position'
class GFKBInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedGenericStackedInline

extra = 0
inline_classes = ('collapse', 'open', 'grp-collapse', 'grp-open')
media
model

alias of nested_admin.tests.gfk.models.GFKB

sortable_field_name = 'position'
class GFKRootAdmin(model, admin_site)[source]

Bases: nested_admin.nested.NestedModelAdmin

inlines = [<class 'nested_admin.tests.gfk.admin.GFKAInline'>]
media

nested_admin.tests.gfk.models module

class GFKA(id, slug, position, content_type, object_id)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

b_set

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

content_object

Provide a generic many-to-one relation through the content_type and object_id fields.

This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.

content_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

content_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

object_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class GFKB(id, name, position, content_type, object_id)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

content_object

Provide a generic many-to-one relation through the content_type and object_id fields.

This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.

content_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

content_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

object_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class GFKRoot(id, slug)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

a_set

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

nested_admin.tests.gfk.tests module

class TestGenericInlineAdmin(methodName='runTest')[source]

Bases: nested_admin.tests.base.BaseNestedAdminTestCase

root_model

alias of nested_admin.tests.gfk.models.GFKRoot

test_add_to_empty_one_deep()[source]
test_add_to_empty_two_deep()[source]
test_delete_one_deep()[source]
test_delete_two_deep()[source]
test_delete_two_deep_undelete_one_deep()[source]

Test that, if an item is deleted, then the parent is deleted, and then the parent is undeleted, that the item stays deleted.

test_drag_add_drag()[source]
test_drag_existing_gfkb_to_new_parent_and_back()[source]
test_drag_existing_objs()[source]
test_drag_item_to_empty_parent()[source]
test_drag_item_to_new_empty_parent()[source]
test_drag_new_item()[source]
test_remove_two_deep()[source]

Module contents