mirror of
https://github.com/kennethreitz/records.git
synced 2026-06-05 23:00:20 +00:00
Added __repr__
I used __class__.__name__ instead of Database for potential subclasses.
This commit is contained in:
@@ -196,6 +196,11 @@ class Database(object):
|
||||
def __exit__(self, exc, val, traceback):
|
||||
self.close()
|
||||
|
||||
def __repr__(self):
|
||||
status = 'Open' if self.open else 'Closed'
|
||||
r = '{}(url={}, status={})'.format(self.__class__.__name__, self.db_url, status)
|
||||
return r
|
||||
|
||||
def _enable_hstore(self):
|
||||
"""Enables HSTORE support, if available."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user