From 7f1a3adf22a9e70ce99656ae1c283a58aef3180a Mon Sep 17 00:00:00 2001 From: absurdo Date: Mon, 9 Oct 2023 17:56:56 +0200 Subject: [PATCH] Fixes in coreforms and ausers --- paramecio2/libraries/db/coreforms.py | 3 ++- paramecio2/modules/admin/admin/ausers.py | 7 +++++-- setup.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/paramecio2/libraries/db/coreforms.py b/paramecio2/libraries/db/coreforms.py index ebbbb05..caed634 100644 --- a/paramecio2/libraries/db/coreforms.py +++ b/paramecio2/libraries/db/coreforms.py @@ -42,12 +42,13 @@ class BaseForm: self.error=False self.name_field_id=self.name+'_form' self.help='' + self.placeholder='' def form(self): """Method for returm the html code of the form """ - return '' + return '' def show_formatted(self, value): """Method for show the value of form formatted diff --git a/paramecio2/modules/admin/admin/ausers.py b/paramecio2/modules/admin/admin/ausers.py index 644e640..23274da 100644 --- a/paramecio2/modules/admin/admin/ausers.py +++ b/paramecio2/modules/admin/admin/ausers.py @@ -4,6 +4,7 @@ from paramecio2.modules.admin.models.admin import UserAdmin from paramecio2.libraries.generate_admin_class import GenerateAdminClass from paramecio2.libraries.i18n import I18n from paramecio2.libraries.db.coreforms import SelectForm +from paramecio2.libraries.db.coreforms import HiddenForm import copy from paramecio2.modules.admin import admin_app, t as admin_t @@ -22,7 +23,9 @@ def ausers(): user_admin.fields['double_auth'].name_form=SelectForm - user_admin.create_forms(['username', 'password', 'email', 'privileges', 'lang', 'disabled', 'double_auth']) + user_admin.fields['last_login'].name_form=HiddenForm + + user_admin.create_forms(['username', 'password', 'email', 'privileges', 'lang', 'disabled', 'double_auth', 'last_login']) user_admin.forms['privileges'].arr_select={0: I18n.lang('admin', 'without_privileges', 'Without privileges'), 1: I18n.lang('admin', 'selected_privileges', 'Selected privileges'), 2: I18n.lang('admin', 'administrator', 'Administrator')} @@ -43,7 +46,7 @@ def ausers(): admin.list.search_fields=['username'] - admin.arr_fields_edit=['username', 'password', 'repeat_password', 'email', 'lang', 'double_auth', 'disabled'] + admin.arr_fields_edit=['username', 'password', 'repeat_password', 'email', 'lang', 'double_auth', 'disabled', 'last_login'] form_admin=admin.show() diff --git a/setup.py b/setup.py index 3a27664..74d265c 100644 --- a/setup.py +++ b/setup.py @@ -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 setup(name='paramecio2', - version='2.0.22', + version='2.0.23', 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',