{% extends 'doc/en/base.html' %} {% load static %} {% block content %} {% verbatim %}
from Book.models import Author, Book
from blitz_work.blitzcrud import BlitzCRUD
class BookCRUD(BlitzCRUD):
show_title = True
show_caption = False
caption_is_title = True
extend_template = "base.html"
data = Book
class BlitzCRUD(View):
template_name = "blitz_base_crud.html"
extend_template = "blitz_base_offline.html"
table_template = "blitz_crud_table.html"
create_template = "blitz_crud_create.html"
update_template = "blitz_crud_update.html"
delete_template = "blitz_crud_delete.html"
detail_template = "blitz_crud_detail.html"
model = None
paginate_by = 20
title = None
form = None
formset = None
show_caption = True
create_title = "Create"
show_title = True
caption_is_title = False
concat_function = default_concatenation
exclude = ['id', ]
dark_mode_switch_label = None
delete_messages = {"success": "Element deleted",
"error": "Error on delete"}
delete_title = "Delete"
update_title = "Edit"
detail_title = "Detail"
delete_text = "The following elements will be deleted, do you want to delete them?"
crud_buttons = {"add": "Add", "create": "Create", "details": "Details", "update": "Update",
"edit": "Edit", "delete": "Delete", "cancel": "Cancel", "return": "Return", "search": "Search"}
allow_anonimous_in_debug = True
Main template.This is the template that renders the list view. Must contain the search buttons, add, edit, delete, cancel and details as well as The data table.
This is the template that will be used as a basis all the views of not being modified.
Its value will be that of the variable (extend_template) on the templates that provides
This is the template that will be used to show the table in the list view of Do not be modified.
This is the template that will be used for the creating view.
This is the template that will be used for the update view.
This is the template that will be used for the delete view.
This is the template that will be used for the details view.
Specifies the model that CRUD uses.
Specifies the number of rows per page in the crud.
Specifies the form that will be used for the Add to Crud view.
If it is not specified
Specifies the form set that will be used for the edit view and details
In CRUD.If not specified
Specifies the function that will be used to concatenate the elements in a relationship (M2M),
In the list view.If it is not specified
def default_concatenation(self, list):
"""
Default concatenation function
"""
return ", ".join(list)
Specify the fields that will be excluded from the model in the table.
Specifies the title of the list view into the crud.
Specifies the title of the creation view on the crud.
Specifies the title of the actulating view in the crud.
Specifies the title of the details view in the crud.
Specifies the title of the disposal view on the crud.
Specifies the message from the removal view on the crud.
Specify the text of crude removal messages.
Specify the text of the crud buttons.
Specifies whether the title is displayed in the crude list view.
Specifies whether the description of the crud table is displayed.Its courage courage to the verbose_name of the model.
Specifies whether the verbose_name of the model will be used as a title.
Specifying dark mode switch text.