basxbread.contrib.taxonomy package

Submodules

basxbread.contrib.taxonomy.models module

class basxbread.contrib.taxonomy.models.Term(id, vocabulary, term, slug, disabled, _order)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

disabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_in_order(*, is_next=True)
get_previous_in_order(*, is_next=False)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <basxbread.contrib.taxonomy.models.TermManager object>
save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

term

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

vocabulary

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

vocabulary_id
class basxbread.contrib.taxonomy.models.TermManager(*args, **kwargs)

Bases: Manager

get_queryset()

Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

including_disabled()
class basxbread.contrib.taxonomy.models.Vocabulary(id, name, slug)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_term_order()
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <basxbread.contrib.taxonomy.models.VocabularyManager object>
set_term_order(id_list, using=None)
slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

term_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class basxbread.contrib.taxonomy.models.VocabularyManager(*args, **kwargs)

Bases: Manager

get_queryset()

Return a new QuerySet object. Subclasses can override this method to customize the behavior of the Manager.

basxbread.contrib.taxonomy.urls module

basxbread.contrib.taxonomy.views module

class basxbread.contrib.taxonomy.views.TermsBrowseView(*args, **kwargs)

Bases: BrowseView

columns: Iterable[str | layout.datatable.DataTableColumn] = [('Term', [[ContextFunction(func='<function Lazy.__getattr__.<locals>.<lambda>>')], ContextFunction(func='<function Lazy.__getattr__.<locals>.<lambda>>')], None, True, None, None, None), 'slug']
get(*args, **kwargs)
get_layout()

Returns the layout for this view, returns the layout attribute by default. Either set the layout attribute or override this method.

get_queryset()

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

class basxbread.contrib.taxonomy.views.VocabularyBrowseView(*args, **kwargs)

Bases: BrowseView

columns: Iterable[str | layout.datatable.DataTableColumn] = ['name', 'slug', 'termcount']
rowactions: Iterable[Link] | None = [(<basxbread.utils.links.ModelHref object>, 'Edit', 'edit', [ContextFunction(func='<function editlink.<locals>.<lambda>>')], {}, False, {}, 'Are you sure?'), (<basxbread.utils.links.ModelHref object>, 'Terms of vocabulary', 'tree-view--alt', [], {}, False, {}, 'Are you sure?')]