diff --git a/paramecio/citoplasma/adminutils.py b/paramecio/citoplasma/adminutils.py index 25e83b2..e52b919 100644 --- a/paramecio/citoplasma/adminutils.py +++ b/paramecio/citoplasma/adminutils.py @@ -53,6 +53,8 @@ def get_menu(modules_admin): menu[mod[2]]=mod[0] for submod in mod[1]: + if submod[2] in menu: + print('WARNING: you would not set the admin url for '+submod[2]+' with same general name of module if is not stand alone admin file') menu[submod[2]]=submod return menu @@ -70,4 +72,4 @@ def check_login(): return True return False - \ No newline at end of file + diff --git a/paramecio/citoplasma/httputils.py b/paramecio/citoplasma/httputils.py index fc8a110..9ad67fc 100644 --- a/paramecio/citoplasma/httputils.py +++ b/paramecio/citoplasma/httputils.py @@ -96,3 +96,7 @@ class GetPostFiles: def obtain_files(self): self.files=request.files + +def request_method(): + + return request.method diff --git a/paramecio/citoplasma/lists.py b/paramecio/citoplasma/lists.py index 4ef08e3..1908b35 100644 --- a/paramecio/citoplasma/lists.py +++ b/paramecio/citoplasma/lists.py @@ -42,9 +42,9 @@ class SimpleList: #clean session - self.s['order']='0' + self.order='0' - self.s['order_field']=self.model.name_field_id + self.order_field=self.model.name_field_id self.order_by=self.order_defaults[0] @@ -83,9 +83,9 @@ class SimpleList: def obtain_order(self): - self.s['order']=self.getpostfiles.get.get('order', self.s['order']) + self.order=self.getpostfiles.get.get('order', self.order) - order_k=int(self.s['order']) + order_k=int(self.order) #Obtain from get """ @@ -98,13 +98,13 @@ class SimpleList: self.order_by=self.order_defaults[ order_k ] - self.s['order']=order_k + self.order=order_k def obtain_field_search(self): - self.s['order_field']=self.getpostfiles.get.get('order_field', self.s['order_field']) + self.order_field=self.getpostfiles.get.get('order_field', self.order_field) - field_k=self.s['order_field'] + field_k=self.order_field """ if 'order_field' in request.query.keys(): @@ -113,7 +113,7 @@ class SimpleList: if field_k in self.model.fields.keys(): - self.s['order_field']=field_k + self.order_field=field_k for field in self.fields: @@ -122,16 +122,16 @@ class SimpleList: if type(self.model.fields[field]).__name__=='ForeignKeyField': name_related=self.model.fields[field].related_model.name for k in self.model.fields[field].related_model.fields.keys(): - self.change_order[field+'_'+k]=self.s['order'] + self.change_order[field+'_'+k]=self.order - self.change_order[field]=self.s['order'] + self.change_order[field]=self.order - if self.s['order']==0: + if self.order==0: self.change_order[field_k]=1 else: self.change_order[field_k]=0 - self.order_field=self.s['order_field'] + #self.order_field=self.order_field def search(self): @@ -179,7 +179,7 @@ class SimpleList: num_elements=self.limit_pages - link=add_get_parameters(self.url, search_text=self.search_text, search_field=self.search_field, order=self.s['order']) + link=add_get_parameters(self.url, search_text=self.search_text, search_field=self.search_field, order=self.order) begin_page=self.begin_page diff --git a/paramecio/create_module.py b/paramecio/create_module.py index a58160f..96e7c87 100644 --- a/paramecio/create_module.py +++ b/paramecio/create_module.py @@ -26,6 +26,8 @@ def start(): try: path.mkdir(0o755, True) + open('modules/'+args.path+'/__init__.py', 'a').close() + except: print('Error: cannot create the directory. Check if exists and if you have permissions') diff --git a/paramecio/i18n/admin.py b/paramecio/i18n/admin.py index fdd8b40..caa0939 100644 --- a/paramecio/i18n/admin.py +++ b/paramecio/i18n/admin.py @@ -4,53 +4,53 @@ from paramecio.citoplasma.i18n import I18n I18n.l['en-US']={'admin': {}} -I18n.l['en-US']['admin']['sign_up']='Paramecio Sign up' - -I18n.l['en-US']['admin']['remember_login']='Remember login?' - -I18n.l['en-US']['admin']['send_email']='Email for recovery your password' +I18n.l['en-US']['admin']['login']='Paramecio Login' I18n.l['en-US']['admin']['administrator']='Administrator' -I18n.l['en-US']['admin']['login']='Paramecio Login' - -I18n.l['en-US']['admin']['remember_tries']='Remember that only have 3 attempts' - -I18n.l['en-US']['admin']['welcome_to_paramecio']='Welcome to Paramecio Admin!!!' +I18n.l['en-US']['admin']['without_privileges']='Without privileges' I18n.l['en-US']['admin']['applications']='Applications' +I18n.l['en-US']['admin']['sign_up']='Paramecio Sign up' + I18n.l['en-US']['admin']['recovery_password']='Recovery password?' +I18n.l['en-US']['admin']['welcome_to_paramecio']='Welcome to Paramecio Admin!!!' + I18n.l['en-US']['admin']['send_password_email']='Your new password' -I18n.l['en-US']['admin']['selected_privileges']='Selected privileges' +I18n.l['en-US']['admin']['remember_tries']='Remember that only have 3 attempts' -I18n.l['en-US']['admin']['without_privileges']='Without privileges' +I18n.l['en-US']['admin']['send_email']='Email for recovery your password' + +I18n.l['en-US']['admin']['remember_login']='Remember login?' + +I18n.l['en-US']['admin']['selected_privileges']='Selected privileges' I18n.l['es-ES']={'admin': {}} -I18n.l['es-ES']['admin']['sign_up']='Registrarse en Paramecio' - -I18n.l['es-ES']['admin']['remember_login']='¿Recordad login?' - -I18n.l['es-ES']['admin']['send_email']='Email para recuperar tu contraseña' +I18n.l['es-ES']['admin']['login']='Login Paramecio' I18n.l['es-ES']['admin']['administrator']='Administrador' -I18n.l['es-ES']['admin']['login']='Login Paramecio' - -I18n.l['es-ES']['admin']['remember_tries']='Recuerda que sólo tienes 3 intentos' - -I18n.l['es-ES']['admin']['welcome_to_paramecio']='Bienvenido a Paramecio Framework!!!' +I18n.l['es-ES']['admin']['without_privileges']='Sin privilegios' I18n.l['es-ES']['admin']['applications']='Aplicaciones' +I18n.l['es-ES']['admin']['sign_up']='Registrarse en Paramecio' + I18n.l['es-ES']['admin']['recovery_password']='¿Recuperar password?' +I18n.l['es-ES']['admin']['welcome_to_paramecio']='Bienvenido a Paramecio Framework!!!' + I18n.l['es-ES']['admin']['send_password_email']='Tu nuevo password' +I18n.l['es-ES']['admin']['remember_tries']='Recuerda que sólo tienes 3 intentos' + +I18n.l['es-ES']['admin']['send_email']='Email para recuperar tu contraseña' + +I18n.l['es-ES']['admin']['remember_login']='¿Recordar login?' + I18n.l['es-ES']['admin']['selected_privileges']='Privilegios seleccionados' -I18n.l['es-ES']['admin']['without_privileges']='Sin privilegios' - diff --git a/paramecio/i18n/common.py b/paramecio/i18n/common.py index 0d33dd9..ad84b2d 100644 --- a/paramecio/i18n/common.py +++ b/paramecio/i18n/common.py @@ -4,93 +4,93 @@ from paramecio.citoplasma.i18n import I18n I18n.l['en-US']={'common': {}} -I18n.l['en-US']['common']['delete']='Delete' +I18n.l['en-US']['common']['password_no_match']='Passwords doesn't match' -I18n.l['en-US']['common']['sign_up']='Sign up' +I18n.l['en-US']['common']['login']='Login' -I18n.l['en-US']['common']['yes']='Yes' +I18n.l['en-US']['common']['error_passwords_no_match']='Error: passwords doesn't match' -I18n.l['en-US']['common']['recovery_password']='Recovery password' - -I18n.l['en-US']['common']['add_new_item']='Add new item' - -I18n.l['en-US']['common']['search']='Search' - -I18n.l['en-US']['common']['error_passwords_no_match']='Error: passwords doesn\'t match' - -I18n.l['en-US']['common']['last']='Last' +I18n.l['en-US']['common']['error_login']='Error, wrong username or password' I18n.l['en-US']['common']['add_item']='Add new item' -I18n.l['en-US']['common']['no']='No' +I18n.l['en-US']['common']['error_username_or_password_exists']='Error: username or email exists in database' -I18n.l['en-US']['common']['delete_item_you_sure']='Are you sure for delete this item?' +I18n.l['en-US']['common']['home']='Home' -I18n.l['en-US']['common']['task_successful']='Task successful' - -I18n.l['en-US']['common']['login']='Login' +I18n.l['en-US']['common']['recovery_password']='Recovery password' I18n.l['en-US']['common']['repeat_password']='Repeat Password' I18n.l['en-US']['common']['pages']='Pages' -I18n.l['en-US']['common']['edit_new_item']='Edit item' +I18n.l['en-US']['common']['delete']='Delete' -I18n.l['en-US']['common']['error_username_or_password_exists']='Error: username or email exists in database' +I18n.l['en-US']['common']['last']='Last' + +I18n.l['en-US']['common']['no']='No' + +I18n.l['en-US']['common']['yes']='Yes' + +I18n.l['en-US']['common']['sign_up']='Sign up' + +I18n.l['en-US']['common']['search']='Search' + +I18n.l['en-US']['common']['task_successful']='Task successful' + +I18n.l['en-US']['common']['delete_item_you_sure']='Are you sure for delete this item?' I18n.l['en-US']['common']['edit']='Edit' +I18n.l['en-US']['common']['edit_new_item']='Edit item' + +I18n.l['en-US']['common']['add_new_item']='Add new item' + I18n.l['en-US']['common']['options']='Options' -I18n.l['en-US']['common']['error_login']='Error, wrong username or password' - -I18n.l['en-US']['common']['home']='Home' - -I18n.l['en-US']['common']['password_no_match']='Passwords doesn\'t match' - I18n.l['es-ES']={'common': {}} -I18n.l['es-ES']['common']['delete']='Borrar' +I18n.l['es-ES']['common']['password_no_match']='Contraseñas no coinciden' -I18n.l['es-ES']['common']['sign_up']='Registrarse' - -I18n.l['es-ES']['common']['yes']='Sí' - -I18n.l['es-ES']['common']['recovery_password']='Recuperar contraseña' - -I18n.l['es-ES']['common']['add_new_item']='Añadir nuevo elemento' - -I18n.l['es-ES']['common']['search']='Buscar' +I18n.l['es-ES']['common']['login']='Autenticación' I18n.l['es-ES']['common']['error_passwords_no_match']='Error: contraseñas no coinciden' -I18n.l['es-ES']['common']['last']='Último' +I18n.l['es-ES']['common']['error_login']='Error, nombre de usuario o password equivocado' I18n.l['es-ES']['common']['add_item']='Añadir elemento' -I18n.l['es-ES']['common']['no']='No' +I18n.l['es-ES']['common']['error_username_or_password_exists']='Error: nombre de usuario o email no existen en la base de datos' -I18n.l['es-ES']['common']['delete_item_you_sure']='¿Estás seguro de que deseas borrar este elemento?' +I18n.l['es-ES']['common']['home']='Home' -I18n.l['es-ES']['common']['task_successful']='Tarea realizada con éxito' - -I18n.l['es-ES']['common']['login']='Autenticación' +I18n.l['es-ES']['common']['recovery_password']='Recuperar contraseña' I18n.l['es-ES']['common']['repeat_password']='Repetir contraseña' I18n.l['es-ES']['common']['pages']='Paginas' -I18n.l['es-ES']['common']['edit_new_item']='Editar elemento' +I18n.l['es-ES']['common']['delete']='Borrar' -I18n.l['es-ES']['common']['error_username_or_password_exists']='Error: nombre de usuario o email no existen en la base de datos' +I18n.l['es-ES']['common']['last']='Último' + +I18n.l['es-ES']['common']['no']='No' + +I18n.l['es-ES']['common']['yes']='Sí' + +I18n.l['es-ES']['common']['sign_up']='Registrarse' + +I18n.l['es-ES']['common']['search']='Buscar' + +I18n.l['es-ES']['common']['task_successful']='Tarea realizada con éxito' + +I18n.l['es-ES']['common']['delete_item_you_sure']='¿Estás seguro de que deseas borrar este elemento?' I18n.l['es-ES']['common']['edit']='Editar' +I18n.l['es-ES']['common']['edit_new_item']='Editar elemento' + +I18n.l['es-ES']['common']['add_new_item']='Añadir nuevo elemento' + I18n.l['es-ES']['common']['options']='Opciones' -I18n.l['es-ES']['common']['error_login']='Error, nombre de usuario o password equivocado' - -I18n.l['es-ES']['common']['home']='Home' - -I18n.l['es-ES']['common']['password_no_match']='Contraseñas no coinciden' - diff --git a/paramecio/modules/admin/index.py b/paramecio/modules/admin/index.py index 667b022..b2a848e 100644 --- a/paramecio/modules/admin/index.py +++ b/paramecio/modules/admin/index.py @@ -51,9 +51,8 @@ menu=get_menu(config_admin.modules_admin) module_imported={} for k, v in menu.items(): - - if k[:1]!='/': - if type(v).__name__=='list': + if type(v).__name__=='list': + if k[:1]!='/': module_imported[k]=import_module(v[1]) #print(d) diff --git a/paramecio/modules/admin/templates/admin/home.html b/paramecio/modules/admin/templates/admin/home.html index db7f31e..48ab49f 100644 --- a/paramecio/modules/admin/templates/admin/home.html +++ b/paramecio/modules/admin/templates/admin/home.html @@ -31,7 +31,7 @@ ${HeaderHTML.header_home()|n}