class documentation

class GenericRelation(ForeignObject):

View In Hierarchy

Provide a reverse to a relation created by a GenericForeignKey.
Method __init__ Undocumented
Method ​_check​_generic​_foreign​_key​_existence Undocumented
Method ​_get​_path​_info​_with​_parent Return the path that joins the current model through any parent models. The idea is that if you have a GFK defined on a parent model then we need to join the parent model first, then the child model.
Method ​_is​_matching​_generic​_foreign​_key Return True if field is a GenericForeignKey whose content type and object id fields correspond to the equivalent attributes on this GenericRelation.
Method bulk​_related​_objects Return all objects related to objs via this GenericRelation.
Method check Undocumented
Method contribute​_to​_class Undocumented
Method get​_content​_type Return the content type associated with this field's model.
Method get​_extra​_restriction Undocumented
Method get​_internal​_type Undocumented
Method get​_path​_info Undocumented
Method get​_reverse​_path​_info Undocumented
Method resolve​_related​_fields Undocumented
Method set​_attributes​_from​_rel Undocumented
Method value​_to​_string Undocumented
Class Variable auto​_created Undocumented
Class Variable empty​_strings​_allowed Undocumented
Class Variable many​_to​_many Undocumented
Class Variable many​_to​_one Undocumented
Class Variable mti​_inherited Undocumented
Class Variable one​_to​_many Undocumented
Class Variable one​_to​_one Undocumented
Instance Variable content​_type​_field​_name Undocumented
Instance Variable for​_concrete​_model Undocumented
Instance Variable model Undocumented
Instance Variable object​_id​_field​_name Undocumented
Instance Variable to​_fields Undocumented
def __init__(self, to, object_id_field='object_id', content_type_field='content_type', for_concrete_model=True, related_query_name=None, limit_choices_to=None, **kwargs):

Undocumented

def _check_generic_foreign_key_existence(self):

Undocumented

def _get_path_info_with_parent(self, filtered_relation):
Return the path that joins the current model through any parent models. The idea is that if you have a GFK defined on a parent model then we need to join the parent model first, then the child model.
def _is_matching_generic_foreign_key(self, field):
Return True if field is a GenericForeignKey whose content type and object id fields correspond to the equivalent attributes on this GenericRelation.
def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):
Return all objects related to objs via this GenericRelation.
def check(self, **kwargs):

Undocumented

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

Undocumented

def get_content_type(self):
Return the content type associated with this field's model.
def get_extra_restriction(self, alias, remote_alias):

Undocumented

def get_internal_type(self):

Undocumented

def get_path_info(self, filtered_relation=None):

Undocumented

def get_reverse_path_info(self, filtered_relation=None):

Undocumented

def resolve_related_fields(self):

Undocumented

def set_attributes_from_rel(self):

Undocumented

def value_to_string(self, obj):

Undocumented

auto_created: bool =

Undocumented

empty_strings_allowed: bool =

Undocumented

many_to_many: bool =

Undocumented

many_to_one: bool =

Undocumented

mti_inherited: bool =

Undocumented

one_to_many: bool =

Undocumented

one_to_one: bool =

Undocumented

content_type_field_name =

Undocumented

for_concrete_model =

Undocumented

model =

Undocumented

object_id_field_name =

Undocumented

to_fields =

Undocumented