本文整理汇总了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>"