diff --git a/README.md b/README.md index 5e2a4e0..2ce86c0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,56 @@ # A simple webframework based in Bottle and Mako for create nice webapps +#Installation + +This guide give you step by step for install paramecio sucessfully. + +## Requirements + +For install Paramecio you need a server preferably with GNU/Linux installed. Paramecio is tested normally in Debian derivated how Ubuntu, and Red hat derivated distros how Centos or Fedora but should work fine in FreeBSD, MacOSX and other *nix like operating systems. + +Also, you need the next software installed in your os: + +### Python 3.4 or later. + +Pastafari should work fine in 3.3 but is tested in 3.4 and 3.5 python 3 versions. + +In Debian and Ubuntu you can install Python 3 using the next command: `apt-get install python3`. + +In Fedora and other Red Hat derived distros you can use `yum install python3`. In RedHat/Centos 6 or 7 you need install [Ius Repos](https://ius.io/GettingStarted/) for get sane versions of python3. + +### MySQL or MariaDB database servers. + +MariaDB 10.0 and later are recommended. + +In Debian and Ubuntu you can install MariaDB using the next command: `apt-get install mariadb-server`. + +In Fedora and other Red Hat derived distros you can use `yum install mariadb-server`. +In RedHat/Centos 6 probably you need install adittional repositories for get latest versions of mariadb, but with MySQL 5.5, Pastafari should work fine. + +When you will install the mysql server, you should create a new user amd database for Paramecio. + +### Pip + +Pip is the package manager of python. You can use the package manager of your os for get python dependencies packages but in my experience is better install the packages directly with pip. + +In Debian and Ubuntu you can install pip using the next command: `apt-get install python3-pip`. + +In Fedora and other Red Hat derived distros you can use `yum install python3-pip`. Of course, the command can change if you use Centos 6/7 with **Ius repos**. + +### Git + +[Git](https://git-scm.com/) is a tool used for manage source code repositories. Also is a tool that can be used for distribute software. For install the next tools you need git install in your server. + +In Debian and Ubuntu you can install git using the next command: `apt-get install git`. + +In Fedora and other Red Hat derived distros you can use `yum install git`. + +## Install Paramecio Framework + +Pastafari need a web framework called Paramecio. You can install this framework using the next command in your server: + +`pip3 install git+https://github.com/paramecio/parameciofm` + +This command will install in your server paramecio framework with its dependencies. + +When Paramecio finish the installing, a command called `paramecio` can be used for install Pastafari. diff --git a/paramecio/cromosoma/corefields.py b/paramecio/cromosoma/corefields.py index f5f4c6c..06a5641 100644 --- a/paramecio/cromosoma/corefields.py +++ b/paramecio/cromosoma/corefields.py @@ -4,11 +4,27 @@ from paramecio.citoplasma.i18n import I18n class IntegerField(PhangoField): + """Class that figure an integer sql type field. + + Args: + name (str): The name of new field + size (int): The size of the new field in database. By default 11. + required (bool): Boolean for define if + + """ + def __init__(self, name, size=11, required=False): super(IntegerField, self).__init__(name, size, required) def check(self, value): + """Method for check if value is integer + + Args: + value (int): The value to check + + """ + self.error=False self.txt_error='' @@ -28,23 +44,53 @@ class IntegerField(PhangoField): return value def get_type_sql(self): + + """Method for return the sql code for this type + + """ return 'INT('+str(self.size)+') NOT NULL DEFAULT "0"' class BigIntegerField(IntegerField): + """Class that figure an big integer sql type field. + + Only change the sql type with respect to IntegerField + + """ + def get_type_sql(self): + + """Method for return the sql code for this type + + """ return 'BIGINT('+str(self.size)+') NOT NULL DEFAULT "0"' class FloatField(PhangoField): + """Class that figure an float sql type field. + + Args: + name (str): The name of new field + size (int): The size of the new field in database. By default 11. + required (bool): Boolean for define if + + """ + def __init__(self, name, size=11, required=False): super(FloatField, self).__init__(name, size, required) def check(self, value): + """Method for check if value is integer + + Args: + value (float): The value to check + + """ + self.error=False self.txt_error='' @@ -82,12 +128,11 @@ class TextField(PhangoField): def __init__(self, name, required=False): super().__init__(name, 11, required) - #def check(self, value): - - #value=super().check(value).replace('"', '"').replace('<', '<').replace(' - - def get_type_sql(self): + + """Method for return the sql code for this type + + """ return 'TEXT NOT NULL' @@ -121,6 +166,10 @@ class ForeignKeyField(IntegerField): return value def get_type_sql(self): + + """Method for return the sql code for this type + + """ return 'INT NULL' @@ -160,6 +209,10 @@ class BooleanField(IntegerField): return value def get_type_sql(self): + + """Method for return the sql code for this type + + """ return 'BOOLEAN NOT NULL DEFAULT "0"' diff --git a/paramecio/i18n/admin.py b/paramecio/i18n/admin.py index 2a64002..2ac135c 100644 --- a/paramecio/i18n/admin.py +++ b/paramecio/i18n/admin.py @@ -4,37 +4,53 @@ from paramecio.citoplasma.i18n import I18n I18n.l['en-US']={'admin': {}} -I18n.l['en-US']['admin']['welcome_to_paramecio']='Welcome to Paramecio Admin!!!' - -I18n.l['en-US']['admin']['administrator']='Administrator' +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']['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']['applications']='Applications' + +I18n.l['en-US']['admin']['recovery_password']='Recovery password?' + +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']['without_privileges']='Without privileges' -I18n.l['en-US']['admin']['sign_up']='Paramecio Sign up' - -I18n.l['en-US']['admin']['applications']='Applications' - I18n.l['es-ES']={'admin': {}} -I18n.l['es-ES']['admin']['welcome_to_paramecio']='Welcome to Paramecio 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']['administrator']='Administrador' -I18n.l['es-ES']['admin']['remember_login']='Remember login?' +I18n.l['es-ES']['admin']['login']='Login Paramecio' -I18n.l['es-ES']['admin']['login']='Paramecio Login' +I18n.l['es-ES']['admin']['remember_tries']='Recuerda que sólo tienes 3 intentos' -I18n.l['es-ES']['admin']['selected_privileges']='Selected privileges' - -I18n.l['es-ES']['admin']['without_privileges']='Without privileges' - -I18n.l['es-ES']['admin']['sign_up']='Paramecio Sign up' +I18n.l['es-ES']['admin']['welcome_to_paramecio']='Bienvenido a Paramecio Framework!!!' I18n.l['es-ES']['admin']['applications']='Aplicaciones' +I18n.l['es-ES']['admin']['recovery_password']='¿Recuperar password?' + +I18n.l['es-ES']['admin']['send_password_email']='Tu nuevo password' + +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 2af4219..4442770 100644 --- a/paramecio/i18n/common.py +++ b/paramecio/i18n/common.py @@ -6,79 +6,91 @@ 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']['error_login']='Error, wrong username or password' +I18n.l['en-US']['common']['sign_up']='Sign up' I18n.l['en-US']['common']['yes']='Yes' -I18n.l['en-US']['common']['task_successful']='Task successful' - -I18n.l['en-US']['common']['error_passwords_no_match']='Error: passwords doesn't match' - -I18n.l['en-US']['common']['options']='Options' +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']['add_item']='Add new item' - -I18n.l['en-US']['common']['home']='Home' - I18n.l['en-US']['common']['search']='Search' -I18n.l['en-US']['common']['error_username_or_password_exists']='Error: username or email exists in database' - -I18n.l['en-US']['common']['no']='No' - -I18n.l['en-US']['common']['login']='Login' - -I18n.l['en-US']['common']['edit_new_item']='Edit item' - -I18n.l['en-US']['common']['sign_up']='Sign up' +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']['edit']='Edit' +I18n.l['en-US']['common']['add_item']='Add new item' + +I18n.l['en-US']['common']['no']='No' + +I18n.l['en-US']['common']['delete_item_you_sure']='Are you sure for delete this item?' + +I18n.l['en-US']['common']['task_successful']='Task successful' + +I18n.l['en-US']['common']['login']='Login' 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']['error_username_or_password_exists']='Error: username or email exists in database' + +I18n.l['en-US']['common']['edit']='Edit' + +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']='Delete' +I18n.l['es-ES']['common']['delete']='Borrar' -I18n.l['es-ES']['common']['password_no_match']='Passwords doesn't match' +I18n.l['es-ES']['common']['sign_up']='Registrarse' -I18n.l['es-ES']['common']['error_login']='Error, wrong username or password' +I18n.l['es-ES']['common']['yes']='Sí' -I18n.l['es-ES']['common']['yes']='Yes' +I18n.l['es-ES']['common']['recovery_password']='Recuperar contraseña' -I18n.l['es-ES']['common']['task_successful']='Task successful' +I18n.l['es-ES']['common']['add_new_item']='Añadir nuevo elemento' -I18n.l['es-ES']['common']['error_passwords_no_match']='Error: passwords doesn't match' +I18n.l['es-ES']['common']['search']='Buscar' -I18n.l['es-ES']['common']['options']='Options' +I18n.l['es-ES']['common']['error_passwords_no_match']='Error: contraseñas no coinciden' -I18n.l['es-ES']['common']['add_new_item']='Add new item' +I18n.l['es-ES']['common']['last']='Último' -I18n.l['es-ES']['common']['add_item']='Add new item' - -I18n.l['es-ES']['common']['home']='Home' - -I18n.l['es-ES']['common']['search']='Search' - -I18n.l['es-ES']['common']['error_username_or_password_exists']='Error: username or email exists in database' +I18n.l['es-ES']['common']['add_item']='Añadir elemento' I18n.l['es-ES']['common']['no']='No' -I18n.l['es-ES']['common']['login']='Login' +I18n.l['es-ES']['common']['delete_item_you_sure']='¿Estás seguro de que deseas borrar este elemento?' -I18n.l['es-ES']['common']['edit_new_item']='Edit item' +I18n.l['es-ES']['common']['task_successful']='Tarea realizada con éxito' -I18n.l['es-ES']['common']['sign_up']='Sign up' +I18n.l['es-ES']['common']['login']='Autenticación' -I18n.l['es-ES']['common']['last']='Last' +I18n.l['es-ES']['common']['repeat_password']='Repetir contraseña' -I18n.l['es-ES']['common']['edit']='Edit' +I18n.l['es-ES']['common']['pages']='Paginas' -I18n.l['es-ES']['common']['repeat_password']='Repeat Password' +I18n.l['es-ES']['common']['edit_new_item']='Editar elemento' + +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']['edit']='Editar' + +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'