categories.editor.tree_editor.TreeEditorQuerySet
TreeEditorQuerySet#
- class categories.editor.tree_editor.TreeEditorQuerySet(model=None, query=None, using=None, hints=None)[source]#
A special query set used only in the TreeEditor ChangeList page.
The only difference to a regular QuerySet is that it will enforce:
The result is ordered in correct tree order so that the TreeAdmin works all right.
It ensures that all ancestors of selected items are included in the result set, so the resulting tree display actually makes sense.
Methods
aggregate(*args, **kwargs)Return a dictionary containing the calculations (aggregation) over the current queryset.
alias(*args, **kwargs)Return a query set with added aliases for extra data or aggregations.
all()Return a new QuerySet that is a copy of the current one.
annotate(*args, **kwargs)Return a query set in which the returned objects have been annotated with extra data or aggregations.
as_manager()bulk_create(objs[, batch_size, ignore_conflicts])Insert each of the instances into the database.
bulk_update(objs, fields[, batch_size])Update the given fields in each of the given objects in the database.
complex_filter(filter_obj)Return a new QuerySet instance with filter_obj added to the filters.
count()Perform a SELECT COUNT() and return the number of records as an integer.
create(**kwargs)Create a new object with the given kwargs, saving it to the database and returning the created object.
dates(field_name, kind[, order])Return a list of date objects representing all available dates for the given field_name, scoped to 'kind'.
datetimes(field_name, kind[, order, tzinfo, ...])Return a list of datetime objects representing all available datetimes for the given field_name, scoped to 'kind'.
defer(*fields)Defer the loading of data for certain fields until they are accessed.
delete()Delete the records in the current QuerySet.
difference(*other_qs)distinct(*field_names)Return a new QuerySet instance that will select only distinct results.
earliest(*fields)exclude(*args, **kwargs)Return a new QuerySet instance with NOT (args) ANDed to the existing set.
exists()explain(*[, format])extra([select, where, params, tables, ...])Add extra SQL fragments to the query.
filter(*args, **kwargs)Return a new QuerySet instance with the args ANDed to the existing set.
first()Return the first object of a query or None if no match is found.
get(*args, **kwargs)Quick and dirty hack to fix change_view and delete_view.
get_or_create([defaults])Look up an object with the given kwargs, creating one if necessary.
in_bulk([id_list, field_name])Return a dictionary mapping each of the given IDs to the object with that ID.
intersection(*other_qs)iterator()Iterates through the items in thee query set.
last()Return the last object of a query or None if no match is found.
latest(*fields)none()Return an empty QuerySet.
only(*fields)Essentially, the opposite of defer().
order_by(*field_names)Return a new QuerySet instance with the ordering changed.
prefetch_related(*lookups)Return a new QuerySet instance that will prefetch the specified Many-To-One and Many-To-Many related objects when the QuerySet is evaluated.
raw(raw_query[, params, translations, using])resolve_expression(*args, **kwargs)reverse()Reverse the ordering of the QuerySet.
select_for_update([nowait, skip_locked, of, ...])Return a new QuerySet instance that will select objects with a FOR UPDATE lock.
select_related(*fields)Return a new QuerySet instance that will select related objects.
union(*other_qs[, all])update(**kwargs)Update all elements in the current QuerySet, setting all the given fields to the appropriate values.
update_or_create([defaults])Look up an object with the given kwargs, updating one with defaults if it exists, otherwise create a new one.
using(alias)Select which database this QuerySet should execute against.
values(*fields, **expressions)values_list(*fields[, flat, named])Attributes
dbReturn the database used if this query is executed now.
orderedReturn True if the QuerySet is ordered -- i.e. has an order_by() clause or a default ordering on the model (or is empty).
query