websauna.system.admin.views module

Admin interface main views.

class websauna.system.admin.views.Add(context, request)[source]

Bases: websauna.system.crud.views.Add

Default add view for model admin.

add()[source]

View for showing an individual object.

base_template = 'admin/base.html'
form_generator = <websauna.system.crud.formgenerator.SQLAlchemyFormGenerator object>
class websauna.system.admin.views.Delete(context, request)[source]

Bases: websauna.system.crud.views.Delete

Delete view for SQLAlchemy model admins.

base_template = 'admin/base.html'
deleter(context, request)

A view callback to delete item in SQLAlchemy CRUD.

Parameters:
  • view (object) – View object.
  • context (Resource) – Traversal context
  • request (Request) – Current HTTP Request.
class websauna.system.admin.views.Edit(context, request)[source]

Bases: websauna.system.crud.views.Edit

Default edit vie for model admin.

base_template = 'admin/base.html'
edit()[source]

View for showing an individual object.

form_generator = <websauna.system.crud.formgenerator.SQLAlchemyFormGenerator object>
class websauna.system.admin.views.Listing(context, request)[source]

Bases: websauna.system.crud.views.Listing

Base listing view for all admin models.

base_template = 'admin/base.html'
listing()[source]

View for listing model contents in CRUD.

table = <websauna.system.crud.listing.Table object>
title
class websauna.system.admin.views.Show(context, request)[source]

Bases: websauna.system.crud.views.Show

Default show view for model admin.

base_template = 'admin/base.html'
form_generator = <websauna.system.crud.formgenerator.SQLAlchemyFormGenerator object>
resource_buttons = [<websauna.system.crud.views.TraverseLinkButton object>, <websauna.system.crud.views.TraverseLinkButton object>, <websauna.system.crud.views.TraverseLinkButton object>]
show()[source]

View for showing an individual object.

websauna.system.admin.views.admin(request)[source]

Admin front page page.

websauna.system.admin.views.default_model_admin_panel(context, request, **kwargs)[source]

Generic panel for any model admin.

Display count of items in the database.

websauna.system.admin.views.model_admin_default_view(context, request)[source]

Redirect to listing if model admin URL is being accessed without a view name.

websauna.system.admin.views.model_resource_default_view(context, request)[source]

Redirect to show if model instance URL is being accessed without a view name.

websauna.system.admin.views.view__model_admin_root(context, request)[source]

Model admin root does not have a view per se so we redirect to admin root.