Handle Python 3 keys/values iterators
This commit is contained in:
parent
88c0c1a15f
commit
23e484cbed
@ -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):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user