class documentation

class GenericRelation(ForeignObject): (source)

View In Hierarchy

Provide a reverse to a relation created by a GenericForeignKey.

Method __init__ Undocumented
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
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.
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): (source)

Undocumented

def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS): (source)

Return all objects related to ``objs`` via this ``GenericRelation``.

def check(self, **kwargs): (source)

Undocumented

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

Undocumented

def get_content_type(self): (source)

Return the content type associated with this field's model.

def get_extra_restriction(self, alias, remote_alias): (source)

Undocumented

def get_internal_type(self): (source)

Undocumented

def get_path_info(self, filtered_relation=None): (source)

Undocumented

def get_reverse_path_info(self, filtered_relation=None): (source)

Undocumented

def resolve_related_fields(self): (source)

Undocumented

def set_attributes_from_rel(self): (source)

Undocumented

def value_to_string(self, obj): (source)

Undocumented

auto_created: bool = (source)

Undocumented

empty_strings_allowed: bool = (source)

Undocumented

many_to_many: bool = (source)

Undocumented

many_to_one: bool = (source)

Undocumented

mti_inherited: bool = (source)

Undocumented

one_to_many: bool = (source)

Undocumented

one_to_one: bool = (source)

Undocumented

content_type_field_name = (source)

Undocumented

for_concrete_model = (source)

Undocumented

Undocumented

object_id_field_name = (source)

Undocumented

to_fields = (source)

Undocumented

def _check_generic_foreign_key_existence(self): (source)

Undocumented

def _get_path_info_with_parent(self, filtered_relation): (source)

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): (source)

Return True if field is a GenericForeignKey whose content type and object id fields correspond to the equivalent attributes on this GenericRelation.