djcrud_dal_topbar

class djcrud_dal_topbar.views.SearchActionsColumn(verbose_name=None, accessor=None, default=None, visible=True, orderable=None, attrs=None, order_by=None, empty_values=None, localize=None, footer=None, exclude_from_export=False, linkify=False, initial_sort_descending=False)[source]

Bases: Column

render(record, table)[source]

Return the content for a specific cell.

This method can be overridden by table.render_FOO methods on the table or by subclassing .Column.

If the value for this cell is in .empty_values, this method is skipped and an appropriate default value is rendered instead. Subclasses should set .empty_values to () if they want to handle all values in .render.

class djcrud_dal_topbar.views.SearchResultsTable(data=None, order_by=None, orderable=None, empty_text=None, exclude=None, attrs=None, row_attrs=None, pinned_row_attrs=None, sequence=None, prefix=None, order_by_field=None, page_field=None, per_page_field=None, template_name=None, default=None, request=None, show_header=None, show_footer=True, extra_columns=None)[source]

Bases: Table

class djcrud_dal_topbar.views.SearchView(**kwargs)[source]

Bases: PaginationMixin, TemplateViewMixin, ListView

Site-wide search results page with paginated table.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

property title

Human-readable label with the View suffix removed.

has_permission()[source]

Return whether the current user may access this view.

get_paginate_by(queryset)[source]

Rows per page from GET or paginate_by default.

get_queryset()[source]

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 djcrud_dal_topbar.views.SiteSearchView(**kwargs)[source]

Bases: ViewMixin, AlightQuerySetSequenceView

Site-wide autocomplete across opted-in model-router list views.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

property codename

URL segment with the view suffix removed from the class name.

has_permission()[source]

Return whether the current user may access this view.

get_queryset()[source]

Mix results from all querysets in QuerySetSequence if self.mixup.

render_to_response(context)[source]

Return an HTML fragment grouped by model type.

djcrud_dal_topbar.lookup.find_detail_url(model, pk)[source]

Return the detail page path for model/pk, or None.

djcrud_dal_topbar.lookup.iter_model_routers(router)[source]

Yield every ModelRouter under router.

djcrud_dal_topbar.lookup.iter_searchable_list_views(request)[source]

Yield list views opted into site search with permission and search_fields.

djcrud_dal_topbar.lookup.get_list_queryset(list_view)[source]

Scoped queryset for site search (same view permission as list/detail).

Filter qs with icontains OR across search_fields for term.

djcrud_dal_topbar.lookup.mixup_querysets(qs, paginate_by)[source]

Return a queryset with a few results from each sub-queryset.

djcrud_dal_topbar.lookup.build_site_search_queryset(request, q, *, mixup=False, paginate_by=10)[source]

Build a QuerySetSequence for site search.