diff --git a/certidude/api/lease.py b/certidude/api/lease.py index c678fe5..f6f8597 100644 --- a/certidude/api/lease.py +++ b/certidude/api/lease.py @@ -37,19 +37,22 @@ class LeaseResource(object): # BUGBUG SQL_LEASES = """ - SELECT + select acquired, released, address, identities.data as identity - FROM + from addresses - RIGHT JOIN + right join identities - ON + on identities.id = addresses.identity - WHERE + where addresses.released <> 1 + order by + addresses.id + desc """ cnx = config.DATABASE_POOL.get_connection() cursor = cnx.cursor()