refactor: use db independent offset syntax (#31345)

* chore: use db independent offset syntax

* fix: typo

* style: reformat code to black spec

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
Conor
2022-06-14 00:19:07 -05:00
committed by GitHub
parent 39338e70d5
commit 00ef499739
19 changed files with 40 additions and 37 deletions

View File

@@ -21,7 +21,7 @@ def get_party_type(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql(
"""select name from `tabParty Type`
where `{key}` LIKE %(txt)s {cond}
order by name limit %(start)s, %(page_len)s""".format(
order by name limit %(page_len)s offset %(start)s""".format(
key=searchfield, cond=cond
),
{"txt": "%" + txt + "%", "start": start, "page_len": page_len},