因为网站上涉及到大量的数据库操作,我就在想能不能把数据库语句格式化书写到一个类中,然后再其它页面中直接调用。比如把select * from stock_information where stockid  = str(nid)写成select * from StringA where StringB  = StringC
然后再页面中定义StringA=stock_information ;StringB= stockid ;StringC=str(nid);的样子,然后引用select * from StringA where StringB  = StringC