Last active
October 10, 2022 08:28
-
-
Save weiserman/f123b2f6905e7cc040a97c1d9950a65e to your computer and use it in GitHub Desktop.
Frappe Python API example with SQL
This file contains hidden or 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
import frappe | |
// This code is called from a front end script and returns a SQL query with a dictionary list. | |
@frappe.whitelist() | |
def get_rental_articles(first_name): | |
rentals = frappe.db.sql(f""" SELECT * from `tabLibrary Transaction` WHERE library_member = '{first_name}' """, as_dict=True) | |
return rentals |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment