Introduction
Hello Ninjas,
As Robert Frost said: "Two roads diverged in a wood, and I – I took the one less traveled by, and that has made all the difference."

You are thinking that is why I am talking about it. So the reason is that today we will cover unique topics i,e., Settings of CRUD in web2py.
If you search on the web about Settings of CRUD in web2py, you don't find much more about the Settings of CRUD in web2py as Settings of CRUD in web2py is itself a unique topic and so today will cover this topic.
But the first question comes to our mind is that what web2py is.

web2py is an open-source web application written in the python programming language. web2py allows web developers to program dynamic web content using python. It helps users by reducing tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required. It is a full-stack framework consisting of all the components a developer needs to build fully functional web applications. web2py provides various functionalities like creating, modifying, deploying, and managing an application from anywhere using your browser.
The CRUD means Create/Read/Update/Delete, which is an API that is an experimental interface on top of SQLFORM.




CRUD creates an SQLFORM and incorporates the creation, processing of the form, the notification, and the redirection, all in one function.
Settings
Let's discuss the setting of the CRUD attributes and their values with their meaning.

Followings are the list of the CRUD attributes-
To enforce authentication on all crud forms:
crud.settings.auth = auth
Attributes to specify the controller that defines the data function which returns the crud object:
crud.settings.controller = 'default'
Attributes to specify the URL to redirect to after a successful "update" record:
crud.settings.update_next = URL('index')
Attributes to specify the URL to redirect to after a successful "create" record:
crud.settings.create_next = URL('index')
Attributes to specify the URL to redirect to after a successful "delete" record:
crud.settings.delete_next = URL('index')
Attributes to specify the URL to be used for linking uploaded files:
crud.settings.download_url = URL('download')

Attributes to specify extra functions to be executed after standard validation procedures for crud.create forms:
crud.settings.create_onvalidation = StorageList()
Here, StorageList is the same as a Storage object. They are both defined in the file "gluon/storage.py," but it defaults to [] as opposed to None. It allows the following syntax:
crud.settings.create_onvalidation.mytablename.append(lambda form: ...)
Attributes to specify extra functions to be executed after completion of crud.create forms:
crud.settings.create_onaccept = StorageList()
Attributes to specify extra functions to be executed after standard validation procedures for crud.update forms:
crud.settings.update_onvalidation = StorageList()
Attributes to specify extra functions to be executed after completion of crud.update if record is deleted:
crud.settings.update_ondelete = StorageList()
Attributes to specify extra functions to be executed after completion of crud.update forms:
crud.settings.update_onaccept = StorageList()
Attributes to specify extra functions to be executed after completion of crud.delete:
crud.settings.delete_onaccept = StorageList()
Attributes to determine whether the "update" forms should have a "delete" button:
crud.settings.update_deletable = True
Attributes to determine whether the "update" forms should show the id of the edited record:
crud.settings.showid = False
Attributes to determine whether forms should keep the previously inserted values or reset to default after successful submission is
crud.settings.keepvalues = False
Crud always detects whether a record being edited has been modified by a third party in the time between when the form is displayed and when it is submitted. This behavior is equivalent to
form.process(detect_record_change=True)
and it is set in:
crud.settings.detect_record_change = True
It can be changed/disabled by setting the variable to False.
We can change the form style by
crud.settings.formstyle = 'table3cols' or 'table2cols' or 'divs' or 'ul'
You can set the separator in all crud forms:
crud.settings.label_separator = ':'




