generated
This commit is contained in:
39
methods.py.tmpl
Normal file
39
methods.py.tmpl
Normal file
@ -0,0 +1,39 @@
|
||||
#####################################################
|
||||
### THIS IS GENERATED CODE, DO NOT EDIT MANUALLY! ###
|
||||
### ALL CHANGES WILL BE LOST AFTER THE NEXT RUN ###
|
||||
### OF generate.py ###
|
||||
#####################################################
|
||||
|
||||
|
||||
from db import dbGetMany, dbGetOne
|
||||
|
||||
#for $table in $tables
|
||||
def get_${table.name}s(user, token_info):
|
||||
return dbGetMany(user, token_info, {
|
||||
"statement": """
|
||||
SELECT
|
||||
id
|
||||
#for $column in $table.columns
|
||||
,$column.name
|
||||
#end for
|
||||
FROM account_t
|
||||
""",
|
||||
"params": ()
|
||||
}
|
||||
)
|
||||
|
||||
def get_${table.name}(user, token_info, ${table.name}Id=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
SELECT
|
||||
id
|
||||
#for $column in $table.columns
|
||||
,$column.name
|
||||
#end for
|
||||
FROM account_t
|
||||
WHERE id = %s
|
||||
""",
|
||||
"params": (${table.name}Id, )
|
||||
}
|
||||
)
|
||||
#end for
|
Reference in New Issue
Block a user