Handle Python 3 keys/values iterators
This commit is contained in:
@@ -103,8 +103,9 @@ class Database(object):
|
|||||||
>>> print db.tables
|
>>> print db.tables
|
||||||
set([u'user', u'action'])
|
set([u'user', u'action'])
|
||||||
"""
|
"""
|
||||||
return list(set(self.metadata.tables.keys() +
|
return list(
|
||||||
self._tables.keys()))
|
set(self.metadata.tables.keys()) | set(self._tables.keys())
|
||||||
|
)
|
||||||
|
|
||||||
def create_table(self, table_name, primary_id='id', primary_type='Integer'):
|
def create_table(self, table_name, primary_id='id', primary_type='Integer'):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ class Table(object):
|
|||||||
Returns the number of rows in the table.
|
Returns the number of rows in the table.
|
||||||
"""
|
"""
|
||||||
d = self.database.query(self.table.count()).next()
|
d = self.database.query(self.table.count()).next()
|
||||||
return d.values().pop()
|
return list(d.values()).pop()
|
||||||
|
|
||||||
def distinct(self, *columns, **_filter):
|
def distinct(self, *columns, **_filter):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user