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.commentsis a ReverseGenericManyToOneDescriptor instance.
-
content_object¶ Provide a generic many-to-one relation through the
content_typeandobject_idfields.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.parentis aForwardManyToOneDescriptorinstance.
-
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.
-
exception
-
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_typeandobject_idfields.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.parentis aForwardManyToOneDescriptorinstance.
-
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.
-
exception
-
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.commentsis 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.
-
exception
nested_admin.tests.gfk.tests module¶
-
class
TestGenericInlineAdmin(methodName='runTest')[source]¶ Bases:
nested_admin.tests.base.BaseNestedAdminTestCase-
root_model¶
-