Fixes in htmlform
This commit is contained in:
parent
849cb07b7b
commit
e0dd761956
7 changed files with 14 additions and 10 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class JsonValueField(PhangoField):
|
|||
return 'JSON'
|
||||
|
||||
def check(self, value):
|
||||
|
||||
#print(value)
|
||||
try:
|
||||
final_value=json.dumps(value)
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -53,12 +53,16 @@ def admin_prepare():
|
|||
|
||||
else:
|
||||
|
||||
url_redirect=config.domain_url+url_for('admin_app.logout', _external=False)
|
||||
session.clear()
|
||||
|
||||
url_redirect=config.domain_url+url_for('admin_app.login', _external=False)
|
||||
|
||||
return redirect(url_redirect)
|
||||
else:
|
||||
|
||||
url_redirect=config.domain_url+url_for('admin_app.logout', _external=False)
|
||||
session.clear()
|
||||
|
||||
url_redirect=config.domain_url+url_for('admin_app.login', _external=False)
|
||||
|
||||
return redirect(url_redirect)
|
||||
|
||||
|
|
@ -69,7 +73,7 @@ def admin_prepare():
|
|||
return redirect(url_redirect)
|
||||
else:
|
||||
|
||||
#print(session['verify_auth'])
|
||||
|
||||
if request.endpoint!='admin_app.logout':
|
||||
|
||||
if not session.get('verify_auth', True):
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
|
|||
name = "paramecio2"
|
||||
authors = [{name = "Antonio de la Rosa", email = "antonio.delarosa@salirdelhoyo.com"}]
|
||||
readme = "README.md"
|
||||
version = "2.0.38"
|
||||
version = "2.0.39"
|
||||
description = "A simple framework using flask and mako"
|
||||
# dynamic = ["version", "description"]
|
||||
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -13,7 +13,7 @@ if sys.version_info < (3, 9):
|
|||
# If you install passlib and bcrypt, the password system will use bcrypt by default, if not, will use native crypt libc
|
||||
|
||||
setup(name='paramecio2',
|
||||
version='2.0.36',
|
||||
version='2.0.39',
|
||||
description='Simple Web Framework based in flask and Mako.',
|
||||
long_description='This framework is a simple framework used for create web apps. Paramecio is modular and fast. By default have a module called admin that can be used for create admin sites',
|
||||
author='Antonio de la Rosa Caballero',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue