class documentation

class GenericForeignKey(FieldCacheMixin):

View In Hierarchy

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.

Instance Variable for​_concrete​_model Undocumented
Method __get__ Undocumented
Method __init__ Undocumented
Method __set__ Undocumented
Method __str__ Undocumented
Method ​_check​_content​_type​_field Check if field named field_name in model model exists and is a valid content_type field (is a ForeignKey to ContentType).
Method ​_check​_field​_name Undocumented
Method ​_check​_object​_id​_field Undocumented
Method check Undocumented
Method contribute​_to​_class Undocumented
Method get​_cache​_name Undocumented
Method get​_content​_type Undocumented
Method get​_filter​_kwargs​_for​_object See corresponding method on Field
Method get​_forward​_related​_filter See corresponding method on RelatedField
Method get​_prefetch​_queryset Undocumented
Class Variable auto​_created Undocumented
Class Variable concrete Undocumented
Class Variable hidden Undocumented
Class Variable is​_relation Undocumented
Class Variable many​_to​_many Undocumented
Class Variable many​_to​_one Undocumented
Class Variable one​_to​_many Undocumented
Class Variable one​_to​_one Undocumented
Class Variable related​_model Undocumented
Class Variable remote​_field Undocumented
Instance Variable column Undocumented
Instance Variable ct​_field Undocumented
Instance Variable editable Undocumented
Instance Variable fk​_field Undocumented
Instance Variable model Undocumented
Instance Variable name Undocumented
Instance Variable rel Undocumented

Inherited from FieldCacheMixin:

Method delete​_cached​_value Undocumented
Method get​_cached​_value Undocumented
Method is​_cached Undocumented
Method set​_cached​_value Undocumented
for_concrete_model =

Undocumented

def __get__(self, instance, cls=None):

Undocumented

def __init__(self, ct_field='content_type', fk_field='object_id', for_concrete_model=True):

Undocumented

def __set__(self, instance, value):

Undocumented

def __str__(self):

Undocumented

def _check_content_type_field(self):
Check if field named field_name in model model exists and is a valid content_type field (is a ForeignKey to ContentType).
def _check_field_name(self):

Undocumented

def _check_object_id_field(self):

Undocumented

def check(self, **kwargs):

Undocumented

def contribute_to_class(self, cls, name, **kwargs):

Undocumented

def get_cache_name(self):
def get_content_type(self, obj=None, id=None, using=None):

Undocumented

def get_filter_kwargs_for_object(self, obj):
See corresponding method on Field
def get_forward_related_filter(self, obj):
See corresponding method on RelatedField
def get_prefetch_queryset(self, instances, queryset=None):

Undocumented

auto_created: bool =

Undocumented

concrete: bool =

Undocumented

hidden: bool =

Undocumented

is_relation: bool =

Undocumented

many_to_many: bool =

Undocumented

many_to_one: bool =

Undocumented

one_to_many: bool =

Undocumented

one_to_one: bool =

Undocumented

related_model =

Undocumented

remote_field =

Undocumented

column =

Undocumented

ct_field =

Undocumented

editable: bool =

Undocumented

fk_field =

Undocumented

model =

Undocumented

name =

Undocumented

rel =

Undocumented