# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t


from _objects import SchemaObject
from _pgsql import pgQuery
from wh import xlt
      return "MATERIALIZED VIEW"
    else:
      return "VIEW"
  
  def GetIcon(self):
    icons=[]
    if self.IsMaterialized():
      icons.append("MatView")
    else:
      icons.append("View")
    if self.GetOid() in self.GetDatabase().favourites:
      icons.append('fav')
    return self.GetImageId(icons)


  def GetSql(self):
    definition=self.info.get('definition')
    if not definition:
      definition=self.GetCursor().ExecuteSingle("SELECT pg_get_viewdef(%d, true)" % self.GetOid())
      self.info['definition']=definition
    return "CREATE OR REPLACE %(object)s %(tablespace)s AS\n%(def)s\n%(grant)s" % {
               'object': self.ObjectSql(),
               'tablespace': self.TablespaceSql(), 
               'def': definition, 'grant': self.GrantCommentSql() }
  

  def GetProperties(self):
    if not len(self.properties):
      self.info['definition']=None
      self.properties = [

# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t


# Path: modPg/View.py
from _objects import SchemaObject
from _pgsql import pgQuery
from wh import xlt

      return "MATERIALIZED VIEW"
    else:
      return "VIEW"
  
  def GetIcon(self):
    icons=[]
    if self.IsMaterialized():
      icons.append("MatView")
    else:
      icons.append("View")
    if self.GetOid() in self.GetDatabase().favourites:
      icons.append('fav')
    return self.GetImageId(icons)


  def GetSql(self):
    definition=self.info.get('definition')
    if not definition:
      definition=self.GetCursor().ExecuteSingle("SELECT pg_get_viewdef(%d, true)" % self.GetOid())
      self.info['definition']=definition
    return "CREATE OR REPLACE %(object)s %(tablespace)s AS\n%(def)s\n%(grant)s" % {
               'object': self.ObjectSql(),
               'tablespace': self.TablespaceSql(), 
               'def': definition, 'grant': self.GrantCommentSql() }
  

  def GetProperties(self):
    if not len(self.properties):
      self.info['definition']=None
      self.properties = [

        (xlt("Name"),           self.info['name']),