sqlalchemy.sql.distinct

Here are the examples of the python api sqlalchemy.sql.distinct taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: kairos Source File: sql_backend.py
  def list(self):
    connection = self._client.connect()
    rval = set()
    stmt = select([distinct(self._table.c.name)])

    for row in connection.execute(stmt):
      rval.add(row['name'])
    return list(rval)

Example 2

Project: coilmq Source File: __init__.py
    def destinations(self):
        """
        Provides a list of destinations (queue "addresses") available.

        @return: A list of the detinations available.
        @rtype: C{set}
        """
        session = meta.Session()
        sel = select([distinct(model.frames_table.c.destination)])
        result = session.execute(sel)
        return set([r[0] for r in result.fetchall()])