本文整理匯總了Python中calypso.model.meta.Session.flush方法的典型用法代碼示例。如果您正苦於以下問題:Python Session.flush方法的具體用法?Python Session.flush怎麽用?Python Session.flush使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類calypso.model.meta.Session
的用法示例。
在下文中一共展示了Session.flush方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete
# 需要導入模塊: from calypso.model.meta import Session [as 別名]
# 或者: from calypso.model.meta.Session import flush [as 別名]
def delete(self):
"""
Remove from database
"""
if self.dao != None:
sqlsession.flush()
sqlsession.delete(self.dao)
sqlsession.commit()
del self.dao
示例2: delete
# 需要導入模塊: from calypso.model.meta import Session [as 別名]
# 或者: from calypso.model.meta.Session import flush [as 別名]
def delete(self):
sqlsession.flush()
sqlsession.delete(self.dao)
sqlsession.flush()
for monitor in self.monitors:
monitor.delete()
del self.monitors
sqlsession.commit()
del self.dao
self.monitors=[]
示例3: render_html
# 需要導入模塊: from calypso.model.meta import Session [as 別名]
# 或者: from calypso.model.meta.Session import flush [as 別名]
def render_html(self,for_editing=False, format=None):
sqlsession.flush()
c.name = self.get_name()
c.tiles = self.tiles
if format==None:
c.format = calypso.Session.session.get_display().format
else:
c.format=format
if for_editing:
return render('/tlm/develop/Visualization.html')
else:
return render ('/tlm/telemetrydisplay.html')
示例4: render_html
# 需要導入模塊: from calypso.model.meta import Session [as 別名]
# 或者: from calypso.model.meta.Session import flush [as 別名]
def render_html(self, properties, for_editing=False):
sqlsession.flush()
sqlsession.commit()
c.formatview= self.get_name().replace(' ','_')
c.properties=properties
c.monitors=self.monitors()
c.flatattrs={}
c.x_pos=properties.x_pos()
c.y_pos=properties.y_pos()
for mon in c.monitors:
for attr in mon.attrs():
if not(c.flatattrs.has_key(attr[0])):
c.flatattrs[attr[0]]=attr
c.content_type = 'html'
c.name = self.display.format.name
c.tile = self
c.display_ops=for_editing
try:
return render('/tlm/develop/Visualization-tile_view.html');
except:
import traceback
traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])
return "<b><i>ERROR rendering tile</i></b>"