Documentation for create_view()

This commit is contained in:
Simon Willison 2018-08-02 08:26:38 -07:00
commit 19e1057ead

View file

@ -74,6 +74,17 @@ You can also specify a primary key by passing the ``pk=`` parameter to the ``.in
"is_good_dog": True,
}, pk="id")
Creating views
==============
The ``.create_view()`` method on the database class can be used to create a view:
.. code-block:: python
db.create_view("good_dogs", """
select * from dogs where is_good_dog = 1
""")
Storing JSON
============