# 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
import adm
    icons=[]
    icons.append("Sequence")
    if self.GetOid() in self.GetDatabase().favourites:
      icons.append('fav')
    return self.GetImageId(icons)


  @staticmethod
  def InstancesQuery(parentNode):
    sql=pgQuery("pg_class rel")
    sql.AddCol("rel.oid, relname as name, nspname, ns.oid as nspoid, spcname, pg_get_userbyid(relowner) AS owner, relacl as acl, relkind")
    sql.AddCol("description")
    sql.AddJoin("pg_namespace ns ON ns.oid=rel.relnamespace")
    sql.AddLeft("pg_tablespace ta ON ta.oid=rel.reltablespace")
    sql.AddLeft("pg_description des ON (des.objoid=rel.oid AND des.objsubid=0)")
    sql.AddWhere("relkind  in ('S')")
    sql.AddWhere("relnamespace", parentNode.parentNode.GetOid())
    sql.AddOrder("CASE WHEN nspname='%s' THEN ' ' else nspname END" % "public")
    sql.AddOrder("relname")
    return sql
  
  def GetProperties(self):
    if not len(self.properties):
      row=self.GetCursor().ExecuteRow("SELECT * FROM %s" % self.NameSql())
      self.info.update(row.getDict())
      self.nextval=self.info['last_value']
      if self.info['is_called']:
        self.nextval += self.info['increment_by']
        
      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/Sequence.py
from _objects import SchemaObject
from _pgsql import pgQuery
from wh import xlt
import adm

    icons=[]
    icons.append("Sequence")
    if self.GetOid() in self.GetDatabase().favourites:
      icons.append('fav')
    return self.GetImageId(icons)


  @staticmethod
  def InstancesQuery(parentNode):
    sql=pgQuery("pg_class rel")
    sql.AddCol("rel.oid, relname as name, nspname, ns.oid as nspoid, spcname, pg_get_userbyid(relowner) AS owner, relacl as acl, relkind")
    sql.AddCol("description")
    sql.AddJoin("pg_namespace ns ON ns.oid=rel.relnamespace")
    sql.AddLeft("pg_tablespace ta ON ta.oid=rel.reltablespace")
    sql.AddLeft("pg_description des ON (des.objoid=rel.oid AND des.objsubid=0)")
    sql.AddWhere("relkind  in ('S')")
    sql.AddWhere("relnamespace", parentNode.parentNode.GetOid())
    sql.AddOrder("CASE WHEN nspname='%s' THEN ' ' else nspname END" % "public")
    sql.AddOrder("relname")
    return sql
  
  def GetProperties(self):
    if not len(self.properties):
      row=self.GetCursor().ExecuteRow("SELECT * FROM %s" % self.NameSql())
      self.info.update(row.getDict())
      self.nextval=self.info['last_value']
      if self.info['is_called']:
        self.nextval += self.info['increment_by']
        
      self.properties = [

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