moved SQL to the json proc file and out of model.

This commit is contained in:
Cameron Dawson 2013-05-03 10:29:28 -07:00
Родитель ffb7e1b4cf
Коммит bcedaf4455
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -29,9 +29,9 @@ class RefDataManager(object):
def get_row_by_id(self, table_name, obj_id):
iter_obj = self.dhub.execute(
sql="SELECT * FROM `{0}` WHERE `id` = ?".format(table_name),
proc="reference.selects.get_row_by_id",
replace=[table_name],
placeholders=[obj_id],
host_type="master_host", # @@@ for some reason ``read_host`` doesn't work here. get a key error in datasource.
debug_show=self.DEBUG,
return_type='iter',
)

Просмотреть файл

@ -210,6 +210,11 @@
AND `version` = ?
AND `active_status` = 'active'",
"host":"read_host"
},
"get_row_by_id":{
"sql": "SELECT * FROM REP0
WHERE `id` = ?",
"host":"read_host"
}
}
}