Fix in querybuilder
This commit is contained in:
parent
23d02e3636
commit
6ada28d39b
1 changed files with 18 additions and 0 deletions
|
|
@ -249,3 +249,21 @@ def select_to_dict(model, conditions=['', []], fields_selected=[], raw_query=0,
|
||||||
del_row_id(results)
|
del_row_id(results)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
def select_a_row_where(model, conditions=['', []], fields_selected=[], raw_query=0, begin=0):
|
||||||
|
|
||||||
|
limit="limit "+str(begin)+", 1"
|
||||||
|
|
||||||
|
with select(model, conditions, fields_selected, raw_query) as cursor:
|
||||||
|
|
||||||
|
row=cursor.fetchone()
|
||||||
|
|
||||||
|
if row==None:
|
||||||
|
row=False
|
||||||
|
else:
|
||||||
|
if model.show_formatted:
|
||||||
|
for k, col in row.items():
|
||||||
|
row[k]=model.fields[k].show_formatted(col)
|
||||||
|
|
||||||
|
return row
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue