.views_names() and .views methods, refs #54

This commit is contained in:
Simon Willison 2019-08-17 16:37:05 +03:00
commit 0f1f37db4d
3 changed files with 54 additions and 1 deletions

View file

@ -45,6 +45,8 @@ You can also access tables using the ``.table()`` method like so:
Using this factory function allows you to set :ref:`python_api_table_configuration`.
.. _python_api_tables:
Listing tables
==============
@ -60,6 +62,23 @@ You can also iterate through the table objects themselves using the ``.tables``
>>> db.tables
[<Table dogs>]
.. _python_api_views:
Listing views
=============
``.table_views()`` shows you a list of views in the database::
>>> db.table_views()
['good_dogs']
You can also iterate through view objects using the ``.views`` property::
>>> db.views
[<View good_dogs>]
View objects work the same as table objects, except any attempts to insert or update data will throw an error.
.. _python_api_rows:
Listing rows