I am using web2py with ckeditor.I want to input rich text into the database with SQLFORM. So I choose ckeditor as a field widget. I have installed the ckeditor and here is my db.py:
from plugin_ckeditor import CKEditor
ckeditor = CKEditor(db)
db.define_table("comtable",
Field("com_name",label="name"),
Field("com_property",label="property",requires=IS_IN_SET(['A', 'B', 'C',"D"])),Field("com_detail",label="info",type="text",widget=ckeditor.widget))
and the following is my default.py/index:
def index():
form=SQLFORM(db.comtable,fields = ['com_name',"com_property","com_detail"])
gridform=SQLFORM.smartgrid(db.comtable)
if form.process().accepted:
response.flash="OK"
return dict(form=form,gridform=gridform)
and the following is my index.html:
{{=form}}
{{=gridform}}
After I have input some information into the text with ckeditor widget the record is displayed by the SQLFORM.smartgrid like this: enter image description here
When I click the "view" button I get the following: enter image description here
I don't want to display the text with html tags. I want to get the rich text. Could any one tell me what should I do or need I choose another rich text editor?
With help of the following method you told me the rich text can be displayed when I click the "view" button. However the HTML tags codes are displayed when I click the "edit" button. Is there any method to show the rich text when I click the "edit" button? Thank you very much.