contenttypes.fields.GenericRelation.related_query_name

related_query_name The relation on the related object back to this object doesn’t exist by default. Setting related_query_name creates a relation from the related object back to this one. This allows querying and filtering from the related object.

contenttypes.fields.GenericRelation

class GenericRelation related_query_name The relation on the related object back to this object doesn’t exist by default. Setting related_query_name creates a relation from the related object back to this one. This allows querying and filtering from the related object. If you know which models you’ll be using most often, you can also add a “reverse” generic relationship to enable an additional API. For example: from django.db import models from django.contrib.contenttypes.fields import

contenttypes.fields.GenericForeignKey.for_concrete_model

for_concrete_model If False, the field will be able to reference proxy models. Default is True. This mirrors the for_concrete_model argument to get_for_model().

contenttypes.fields.GenericForeignKey

class GenericForeignKey There are three parts to setting up a GenericForeignKey: Give your model a ForeignKey to ContentType. The usual name for this field is “content_type”. Give your model a field that can store primary key values from the models you’ll be relating to. For most models, this means a PositiveIntegerField. The usual name for this field is “object_id”. Give your model a GenericForeignKey, and pass it the names of the two fields described above. If these fields are named “conte

contenttypes.admin.GenericTabularInline

class GenericTabularInline

contenttypes.admin.GenericStackedInline

class GenericStackedInline Subclasses of GenericInlineModelAdmin with stacked and tabular layouts, respectively.

contenttypes.admin.GenericInlineModelAdmin.ct_fk_field

ct_fk_field The name of the integer field that represents the ID of the related object. Defaults to object_id.

contenttypes.admin.GenericInlineModelAdmin.ct_field

ct_field The name of the ContentType foreign key field on the model. Defaults to content_type.

contenttypes.admin.GenericInlineModelAdmin

class GenericInlineModelAdmin The GenericInlineModelAdmin class inherits all properties from an InlineModelAdmin class. However, it adds a couple of its own for working with the generic relation: ct_field The name of the ContentType foreign key field on the model. Defaults to content_type. ct_fk_field The name of the integer field that represents the ID of the related object. Defaults to object_id.

conf.urls.url()

url(regex, view, kwargs=None, name=None) [source] urlpatterns should be a list of url() instances. For example: from django.conf.urls import include, url urlpatterns = [ url(r'^index/$', index_view, name='main-view'), url(r'^weblog/', include('blog.urls')), ... ] The view parameter is a view function or the result of as_view() for class-based views. It can also be an include(). The kwargs parameter allows you to pass additional arguments to the view function or method. See Pass