def METHOD_NAME(self, sent='N'):
    """
    Get all messages with given sent status (normally unsent).
    Returns a list of dictionaries containing messages details of SMS in
    queue with the specified status.
    """
    dbconn = self._connect()
    db = dbconn.cursor()
    data = dict(sent=sent)
    sql = """SELECT smsq.id as smsqid, name, msg, time
        FROM smsq
        JOIN account ON (account.id = smsq.accountid)
        WHERE sent = %(sent)s ORDER BY time ASC"""
    db.execute(sql, data)
    result = []
    for (smsqid, name, msg, time) in db.fetchall():
        result.append(
            dict(
                id=smsqid, name=name, msg=msg, time=time.strftime("%Y-%m-%d %H:%M")
            )
        )
    # Rollback so we don't have old open transactions which foobars the
    # usage of now() in setsentstatus()
    dbconn.rollback()
    return result