From 2a6f1bebd77387d558c2632aa8d492c79b902834 Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:08:47 +0300 Subject: [PATCH] docs: add Spanish README --- README.es-ES.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 README.es-ES.md diff --git a/README.es-ES.md b/README.es-ES.md new file mode 100644 index 0000000..c01af1b --- /dev/null +++ b/README.es-ES.md @@ -0,0 +1,76 @@ +QuickORM +======== + +Un ORM sencillo que proporciona una API elegante para operaciones de Python-MySQL + +Conectarse a MySQL +------------------- + +```python +from data_handler import Database + +db_config = { + 'host': 'localhost', + 'port': 3306, + 'user': 'root', + 'password': '123456', + 'database': 'test' +} +Database.connect(**db_config) +``` + +Definir un modelo +----------------- + +```python +from data_handler import Model, Field + +class TestModel(Model): + db_table = 'test' + a = Field() + b = Field() +``` + +Insertar +-------- + +```python +test = TestModel() +test.a = 5 +test.b = 'john' +test.save() +``` + +Consultar +---------- + +```python +for r in TestModel.where(a=5, b='john').select(): + print r.a + print r.b +``` + +Contar +------- + +```python +print TestModel.where(a=5, b='john').count() +``` + +Actualizar +------------ + +```python +TestModel.where(a=5, b='john').update(a=1) +``` + +Ejecutar SQL puro +------------------- + +```python +from data_handler import execute_raw_sql + +results = execute_raw_sql('select b, count(*) from test where b = %s group by b;', (1,)) +for val, cnt in results: + print val, cnt +```