Added Long text field for webmodel

This commit is contained in:
absurdo 2023-10-23 14:35:58 +02:00
parent faf4c14e2b
commit edf9b1bd30
3 changed files with 19 additions and 1 deletions

View file

@ -24,12 +24,16 @@ def start_app():
application_root='/' application_root='/'
if hasattr(config, 'application_root'): if hasattr(config, 'application_root'):
#print(config.application_root)
application_root=config.application_root application_root=config.application_root
app.config.update( app.config.update(
APPLICATION_ROOT=application_root APPLICATION_ROOT=application_root
) )
#app.config['APPLICATION_ROOT']=application_root
if hasattr(config, 'json_sort_keys'): if hasattr(config, 'json_sort_keys'):
app.config.update( app.config.update(
JSON_SORT_KEYS=config.json_sort_keys JSON_SORT_KEYS=config.json_sort_keys

View file

@ -172,6 +172,20 @@ class TextField(PhangoField):
return 'TEXT '+self.set_default return 'TEXT '+self.set_default
class LongTextField(TextField):
"""Class used for long text fields (32 bits size, 4G)
Class used for text fields, use LONGTEXT sql type for the this field.
"""
def get_type_sql(self):
"""Method for return the sql code for this type
"""
return 'LONGTEXT '+self.set_default
class HTMLField(TextField): class HTMLField(TextField):
"""Class used for html fields """Class used for html fields

View file

@ -13,7 +13,7 @@ if sys.version_info < (3, 8):
# If you install passlib and bcrypt, the password system will use bcrypt by default, if not, will use native crypt libc # If you install passlib and bcrypt, the password system will use bcrypt by default, if not, will use native crypt libc
setup(name='paramecio2', setup(name='paramecio2',
version='2.0.26', version='2.0.27',
description='Simple Web Framework based in flask and Mako.', 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', 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', author='Antonio de la Rosa Caballero',