modern #2
6 changed files with 24 additions and 10 deletions
|
|
@ -40,7 +40,21 @@ def start():
|
||||||
#f=open('modules/'+args.path+'/index.py', 'w')
|
#f=open('modules/'+args.path+'/index.py', 'w')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(workdir+'/examples/index.py', 'modules/'+args.path)
|
shutil.copy(workdir+'/examples/app.py', 'modules/'+args.path)
|
||||||
|
|
||||||
|
with open('modules/'+args.path+'/app.py') as f:
|
||||||
|
|
||||||
|
app_file=f.read()
|
||||||
|
|
||||||
|
name_module=os.path.basename(args.path)
|
||||||
|
|
||||||
|
app_file=app_file.replace('/example', '/'+name_module)
|
||||||
|
|
||||||
|
with open('modules/'+args.path+'/app.py', 'w') as f:
|
||||||
|
|
||||||
|
f.write(app_file)
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
|
||||||
|
|
@ -78,7 +92,7 @@ def regenerate_modules_config():
|
||||||
|
|
||||||
for controller in dir_controllers:
|
for controller in dir_controllers:
|
||||||
|
|
||||||
if controller.find('.py')!=-1 and controller.find('__init__')==-1:
|
if controller.find('.py')!=-1 and controller.find('_')==-1:
|
||||||
|
|
||||||
controller_py=controller.replace('.py', '')
|
controller_py=controller.replace('.py', '')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class DateTimeField(PhangoField):
|
||||||
|
|
||||||
self.utc=False
|
self.utc=False
|
||||||
|
|
||||||
self.error_default='Error: Date format invalid'
|
self.error_default='Error: Date format invalid in %s' % self.name
|
||||||
|
|
||||||
self.type_sql='datetime'
|
self.type_sql='datetime'
|
||||||
|
|
||||||
|
|
@ -49,14 +49,14 @@ class DateTimeField(PhangoField):
|
||||||
elif not datetime.obtain_timestamp(value):
|
elif not datetime.obtain_timestamp(value):
|
||||||
|
|
||||||
self.error=True
|
self.error=True
|
||||||
self.txt_error=self.error_default
|
self.txt_error=self.error_default+' '+value
|
||||||
|
|
||||||
return '0000-00-00 00:00:00'
|
return '0000-00-00 00:00:00'
|
||||||
|
|
||||||
if value==False:
|
if value==False:
|
||||||
|
|
||||||
self.error=True
|
self.error=True
|
||||||
self.txt_error=self.error_default
|
self.txt_error=self.error_default+' '+value
|
||||||
return '0000-00-00 00:00:00'
|
return '0000-00-00 00:00:00'
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class EmailField(CharField):
|
||||||
|
|
||||||
super().__init__(name, size, required)
|
super().__init__(name, size, required)
|
||||||
|
|
||||||
self.error_default='Error: No valid format'
|
self.error_default='Error: No valid format in '+self.name
|
||||||
|
|
||||||
def check(self, value):
|
def check(self, value):
|
||||||
|
|
||||||
|
|
@ -42,6 +42,6 @@ class EmailField(CharField):
|
||||||
|
|
||||||
self.error=True
|
self.error=True
|
||||||
value=""
|
value=""
|
||||||
self.txt_error=self.error_default
|
self.txt_error=self.error_default+' Email:'+value
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
from paramecio.modules.admin.models.admin import UserAdmin
|
from paramecio.modules.admin.models.admin import UserAdmin
|
||||||
from paramecio.libraries.urls import make_url
|
from paramecio.libraries.urls import make_url
|
||||||
from paramecio.libraries.generate_admin_class import GenerateAdminClass
|
from paramecio.libraries.generate_admin_class import GenerateAdminClass
|
||||||
from paramecio2.libraries.i18n import I18n, PGetText
|
from paramecio.libraries.i18n import I18n, PGetText
|
||||||
from paramecio.libraries.db.coreforms import SelectForm
|
from paramecio.libraries.db.coreforms import SelectForm
|
||||||
from paramecio.libraries.sessions import get_session
|
from paramecio.libraries.sessions import get_session
|
||||||
from settings import config
|
from settings import config
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ Home = "https://git.cuchulu.com/paramecio/parameciofm/"
|
||||||
Documentation = "https://docs.cuchulu.com/paramecio/"
|
Documentation = "https://docs.cuchulu.com/paramecio/"
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
paramecio2 = "paramecio.console:start"
|
paramecio = "paramecio.console:start"
|
||||||
paramecio2db = "parmecio.cromosoma.dbadmin:start"
|
parameciodb = "parmecio.cromosoma.dbadmin:start"
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
testpaths = ["tests"]
|
testpaths = ["tests"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue