Fixes in htmlform

This commit is contained in:
Antonio de la Rosa 2025-11-14 21:25:25 +01:00
parent 849cb07b7b
commit e0dd761956
7 changed files with 14 additions and 10 deletions

View file

@ -270,7 +270,7 @@ class HTMLField(TextField):
"""
super().__init__(name, required)
self.trusted_tags=[]
self.trusted_tags=['b', 'strong']
def check(self, value):
"""Check method for html values
@ -298,7 +298,7 @@ class HTMLField(TextField):
"""
value=bleach.clean('<p>"trial"</p><script></script>', tags=self.trusted_tags)
value=bleach.clean(value, tags=self.trusted_tags)
if self.escape:

View file

@ -104,7 +104,7 @@ class JsonValueField(PhangoField):
return 'JSON'
def check(self, value):
#print(value)
try:
final_value=json.dumps(value)

View file

@ -1305,7 +1305,7 @@ class WebModel:
self.arr_sql_set_index[self.name][field]='ALTER TABLE `'+self.name+'` ADD CONSTRAINT `'+field+'_'+self.name+'IDX` FOREIGN KEY ( `'+field+'` ) REFERENCES `'+table_related+'` (`'+id_table_related+'`) ON DELETE CASCADE ON UPDATE CASCADE;'
return "create table `"+self.name+"` (\n"+",\n".join(table_fields)+"\n) DEFAULT CHARSET=utf8;";
return "create table `"+self.name+"` (\n"+",\n".join(table_fields)+"\n) DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;";
def update_table(self, fields_to_add, fields_to_modify, fields_to_add_index, fields_to_add_constraint, fields_to_add_unique, fields_to_delete_index, fields_to_delete_unique, fields_to_delete_constraint, fields_to_delete):

View file

@ -220,7 +220,7 @@ class GenerateAdminClass:
post=dict(request.form)
else:
post=self.request_post
print(post)
if pre_update_ret:
if insert_row(post):