Created
December 13, 2017 01:54
-
-
Save monroy95/8636d0abdb185bfdb5c6c96194d12db9 to your computer and use it in GitHub Desktop.
Consultas (Query) en la base de datos con frappe framework y python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Retorna los nombres de clientes como diccionario. | |
frappe.db.sql('select name from tabCustomer', as_dict=True | |
# Retorna los nombres que empiecen con la letra "a". | |
frappe.db.sql('select name from tabCustomer where name like %s', 'a%') | |
# Valores como diccionario. | |
frappe.db.sql('select name from tabCustomer where name like %(name)s and owner=%(owner)s', | |
{'name':'a%', 'owner':'test@example.com'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment