Fixes in imagefield and jsonfield

This commit is contained in:
absurdo 2023-09-13 00:17:46 +02:00
parent a741e51a76
commit bc05d7725e
3 changed files with 43 additions and 36 deletions

View file

@ -72,7 +72,9 @@ class ImageField(CharField):
#if not change
if not field_file in files_uploaded:
if field_file in files_uploaded:
if files_uploaded[field_file].filename=='':
if value=='':
@ -109,7 +111,11 @@ class ImageField(CharField):
value=os.path.basename(value)
return self.save_folder+'/'+value
else:
value=os.path.basename(value)
return self.save_folder+'/'+value
# Load image file

View file

@ -72,6 +72,7 @@ class JsonValueField(PhangoField):
super().__init__(name, required)
self.error_default='Sorry, the json dict is invalid'
self.default_value={}
#self.set_default='NOT NULL'
@ -86,7 +87,7 @@ class JsonValueField(PhangoField):
except json.JSONDecodeError:
final_value={}
final_value='{}'
self.error=True
self.txt_error=self.error_default

View file

@ -5,7 +5,7 @@ import os
from setuptools import setup, find_packages
if sys.version_info < (3, 6):
if sys.version_info < (3, 8):
raise NotImplementedError("Sorry, you need at least Python 3.6 for use paramecio2.")
#import paramecio
@ -13,7 +13,7 @@ if sys.version_info < (3, 6):
# 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.21',
version='2.0.22',
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',