class documentation

class NestedObjects(Collector): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method add_edge Undocumented
Method can_fast_delete We always want to load the objects into memory so that we can display them to the user in confirm page.
Method collect Add 'objs' to the collection of objects to be deleted as well as all parent instances. 'objs' must be a homogeneous iterable collection of model instances (e.g. a QuerySet). If 'collect_related' is True, related objects will be handled by their respective on_delete handler.
Method nested Return the graph as a nested list.
Method related_objects Get a QuerySet of the related model to objs via related fields.
Instance Variable edges Undocumented
Instance Variable model_objs Undocumented
Instance Variable protected Undocumented
Method _nested Undocumented

Inherited from Collector:

Method add Add 'objs' to the collection of objects to be deleted. If the call is the result of a cascade, 'source' should be the model that caused it, and 'nullable' should be set to True if the relation can be null.
Method add_dependency Undocumented
Method add_field_update Schedule a field update. 'objs' must be a homogeneous iterable collection of model instances (e.g. a QuerySet).
Method add_restricted_objects Undocumented
Method clear_restricted_objects_from_queryset Undocumented
Method clear_restricted_objects_from_set Undocumented
Method delete Undocumented
Method get_del_batches Return the objs in suitably sized batches for the used connection.
Method instances_with_model Undocumented
Method sort Undocumented
Instance Variable data Undocumented
Instance Variable dependencies Undocumented
Instance Variable fast_deletes Undocumented
Instance Variable field_updates Undocumented
Instance Variable origin Undocumented
Instance Variable restricted_objects Undocumented
Instance Variable using Undocumented
Method _has_signal_listeners Undocumented
def __init__(self, *args, **kwargs): (source)
def add_edge(self, source, target): (source)

Undocumented

def can_fast_delete(self, *args, **kwargs): (source)

We always want to load the objects into memory so that we can display them to the user in confirm page.

def collect(self, objs, source=None, source_attr=None, **kwargs): (source)

Add 'objs' to the collection of objects to be deleted as well as all parent instances. 'objs' must be a homogeneous iterable collection of model instances (e.g. a QuerySet). If 'collect_related' is True, related objects will be handled by their respective on_delete handler. If the call is the result of a cascade, 'source' should be the model that caused it and 'nullable' should be set to True, if the relation can be null. If 'reverse_dependency' is True, 'source' will be deleted before the current model, rather than after. (Needed for cascading to parent models, the one case in which the cascade follows the forwards direction of an FK rather than the reverse direction.) If 'keep_parents' is True, data of parent model's will be not deleted. If 'fail_on_restricted' is False, error won't be raised even if it's prohibited to delete such objects due to RESTRICT, that defers restricted object checking in recursive calls where the top-level call may need to collect more objects to determine whether restricted ones can be deleted.

def nested(self, format_callback=None): (source)

Return the graph as a nested list.

def related_objects(self, related_model, related_fields, objs): (source)

Get a QuerySet of the related model to objs via related fields.

Undocumented

model_objs = (source)

Undocumented

protected = (source)

Undocumented

def _nested(self, obj, seen, format_callback): (source)

Undocumented