Towards an DbEngine, for a variety of reasons
svn: r14035
This commit is contained in:
@@ -115,11 +115,12 @@ class Gramplet(object):
|
||||
|
||||
def get_active_object(self, nav_type):
|
||||
"""
|
||||
Return the object of the active object for the given navigation type.
|
||||
Return the object of the active handle for the given navigation type.
|
||||
Assumes nav_type is one of the codes of Db.get_by_name.
|
||||
"""
|
||||
handle = self.uistate.get_active(nav_type, self.nav_group)
|
||||
if handle:
|
||||
return getattr(self.dbstate.db, "get_%s_from_handle" % nav_type.lower())(handle)
|
||||
if nav_type in self.dbstate.db.engine and handle:
|
||||
return self.dbstate.db.engine[nav_type].get(handle=handle)
|
||||
|
||||
def set_active(self, nav_type, handle):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user