seld --> self, pep8
This commit is contained in:
parent
866df01a13
commit
59b49b597d
@ -33,13 +33,13 @@ class Database(object):
|
|||||||
@property
|
@property
|
||||||
def tables(self):
|
def tables(self):
|
||||||
""" Get a listing of all tables that exist in the database. """
|
""" Get a listing of all tables that exist in the database. """
|
||||||
return set(self.metadata.tables.keys() + seld.tables.keys())
|
return set(self.metadata.tables.keys() + self.tables.keys())
|
||||||
|
|
||||||
def create_table(self, table_name):
|
def create_table(self, table_name):
|
||||||
""" Creates a new table. The new table will automatically have
|
""" Creates a new table. The new table will automatically have
|
||||||
an `id` column, which is set to be an auto-incrementing integer
|
an `id` column, which is set to be an auto-incrementing integer
|
||||||
as the primary key of the table.
|
as the primary key of the table.
|
||||||
|
|
||||||
Returns a :py:class:`dataset.Table` instance."""
|
Returns a :py:class:`dataset.Table` instance."""
|
||||||
with self.lock:
|
with self.lock:
|
||||||
log.debug("Creating table: %s on %r" % (table_name, self.engine))
|
log.debug("Creating table: %s on %r" % (table_name, self.engine))
|
||||||
@ -55,7 +55,7 @@ class Database(object):
|
|||||||
exist in the database. If the table exists, its columns will be
|
exist in the database. If the table exists, its columns will be
|
||||||
reflected and are available on the :py:class:`dataset.Table`
|
reflected and are available on the :py:class:`dataset.Table`
|
||||||
object.
|
object.
|
||||||
|
|
||||||
Returns a :py:class:`dataset.Table` instance."""
|
Returns a :py:class:`dataset.Table` instance."""
|
||||||
with self.lock:
|
with self.lock:
|
||||||
log.debug("Loading table: %s on %r" % (table_name, self))
|
log.debug("Loading table: %s on %r" % (table_name, self))
|
||||||
@ -82,7 +82,7 @@ class Database(object):
|
|||||||
""" Run a statement on the database directly, allowing for the
|
""" Run a statement on the database directly, allowing for the
|
||||||
execution of arbitrary read/write queries. A query can either be
|
execution of arbitrary read/write queries. A query can either be
|
||||||
a plain text string, or a SQLAlchemy expression. The returned
|
a plain text string, or a SQLAlchemy expression. The returned
|
||||||
iterator will yield each result sequentially.
|
iterator will yield each result sequentially.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@ -94,4 +94,3 @@ class Database(object):
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<Database(%s)>' % self.url
|
return '<Database(%s)>' % self.url
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user